mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
internal/glfw/glfw: Modify GLFW for Windows to make the window non-floating
Closes #1506
This commit is contained in:
parent
7be00d79e8
commit
1a7cf7b3b8
40
internal/glfw/glfw/README.md
vendored
40
internal/glfw/glfw/README.md
vendored
@ -1,6 +1,8 @@
|
|||||||
These files are basically copy of github.com/v3.3/glfw/glfw.
|
These files are basically copy of github.com/v3.3/glfw/glfw.
|
||||||
|
|
||||||
There is one change from the original files: `GLFWscrollfun` takes pointers instead of values since all arguments of C functions have to be 32bit on 32bit Windows machine.
|
There is one change from the original files.
|
||||||
|
|
||||||
|
`GLFWscrollfun` takes pointers instead of values since all arguments of C functions have to be 32bit on 32bit Windows machine.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
diff --git a/tmp/glfw-3.3.3/include/GLFW/glfw3.h b/./internal/glfw/glfw/include/GLFW/glfw3.h
|
diff --git a/tmp/glfw-3.3.3/include/GLFW/glfw3.h b/./internal/glfw/glfw/include/GLFW/glfw3.h
|
||||||
@ -33,3 +35,39 @@ index 337d5cf0..4ac555cb 100644
|
|||||||
|
|
||||||
// Notifies shared code of a mouse button click event
|
// Notifies shared code of a mouse button click event
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A fullscreened window doesn't float (#1506, glfw/glfw#1967).
|
||||||
|
|
||||||
|
```diff
|
||||||
|
diff --git a/tmp/glfw-3.3.4/src/win32_window.c b/./internal/glfw/glfw/src/win32_window.c
|
||||||
|
index d17b6da4..17e2f842 100644
|
||||||
|
--- a/tmp/glfw-3.3.4/src/win32_window.c
|
||||||
|
+++ b/./internal/glfw/glfw/src/win32_window.c
|
||||||
|
@@ -68,7 +68,7 @@ static DWORD getWindowExStyle(const _GLFWwindow* window)
|
||||||
|
{
|
||||||
|
DWORD style = WS_EX_APPWINDOW;
|
||||||
|
|
||||||
|
- if (window->monitor || window->floating)
|
||||||
|
+ if (window->floating)
|
||||||
|
style |= WS_EX_TOPMOST;
|
||||||
|
|
||||||
|
return style;
|
||||||
|
@@ -436,7 +436,7 @@ static void fitToMonitor(_GLFWwindow* window)
|
||||||
|
{
|
||||||
|
MONITORINFO mi = { sizeof(mi) };
|
||||||
|
GetMonitorInfo(window->monitor->win32.handle, &mi);
|
||||||
|
- SetWindowPos(window->win32.handle, HWND_TOPMOST,
|
||||||
|
+ SetWindowPos(window->win32.handle, window->floating ? HWND_TOPMOST : HWND_NOTOPMOST,
|
||||||
|
mi.rcMonitor.left,
|
||||||
|
mi.rcMonitor.top,
|
||||||
|
mi.rcMonitor.right - mi.rcMonitor.left,
|
||||||
|
@@ -1756,7 +1756,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
|
||||||
|
acquireMonitor(window);
|
||||||
|
|
||||||
|
GetMonitorInfo(window->monitor->win32.handle, &mi);
|
||||||
|
- SetWindowPos(window->win32.handle, HWND_TOPMOST,
|
||||||
|
+ SetWindowPos(window->win32.handle, window->floating ? HWND_TOPMOST : HWND_NOTOPMOST,
|
||||||
|
mi.rcMonitor.left,
|
||||||
|
mi.rcMonitor.top,
|
||||||
|
mi.rcMonitor.right - mi.rcMonitor.left,
|
||||||
|
```
|
||||||
|
6
internal/glfw/glfw/src/win32_window.c
vendored
6
internal/glfw/glfw/src/win32_window.c
vendored
@ -68,7 +68,7 @@ static DWORD getWindowExStyle(const _GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
DWORD style = WS_EX_APPWINDOW;
|
DWORD style = WS_EX_APPWINDOW;
|
||||||
|
|
||||||
if (window->monitor || window->floating)
|
if (window->floating)
|
||||||
style |= WS_EX_TOPMOST;
|
style |= WS_EX_TOPMOST;
|
||||||
|
|
||||||
return style;
|
return style;
|
||||||
@ -436,7 +436,7 @@ static void fitToMonitor(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
MONITORINFO mi = { sizeof(mi) };
|
MONITORINFO mi = { sizeof(mi) };
|
||||||
GetMonitorInfo(window->monitor->win32.handle, &mi);
|
GetMonitorInfo(window->monitor->win32.handle, &mi);
|
||||||
SetWindowPos(window->win32.handle, HWND_TOPMOST,
|
SetWindowPos(window->win32.handle, window->floating ? HWND_TOPMOST : HWND_NOTOPMOST,
|
||||||
mi.rcMonitor.left,
|
mi.rcMonitor.left,
|
||||||
mi.rcMonitor.top,
|
mi.rcMonitor.top,
|
||||||
mi.rcMonitor.right - mi.rcMonitor.left,
|
mi.rcMonitor.right - mi.rcMonitor.left,
|
||||||
@ -1756,7 +1756,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
|
|||||||
acquireMonitor(window);
|
acquireMonitor(window);
|
||||||
|
|
||||||
GetMonitorInfo(window->monitor->win32.handle, &mi);
|
GetMonitorInfo(window->monitor->win32.handle, &mi);
|
||||||
SetWindowPos(window->win32.handle, HWND_TOPMOST,
|
SetWindowPos(window->win32.handle, window->floating ? HWND_TOPMOST : HWND_NOTOPMOST,
|
||||||
mi.rcMonitor.left,
|
mi.rcMonitor.left,
|
||||||
mi.rcMonitor.top,
|
mi.rcMonitor.top,
|
||||||
mi.rcMonitor.right - mi.rcMonitor.left,
|
mi.rcMonitor.right - mi.rcMonitor.left,
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
package glfw
|
package glfw
|
||||||
|
|
||||||
const glfwDLLHash = "e6422fe98c4089e2a7f8ddc41f94ecb156dfda774974326280946db1770543ba"
|
const glfwDLLHash = "9b66cd40f92263367f0076b690cb90174cc981f0c126eb395bc4e35cd8cb767d"
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
package glfw
|
package glfw
|
||||||
|
|
||||||
const glfwDLLHash = "341ab581d5dff977d7b7596a64e5a77e4e730bfce307c4dcf086ca07359a38d1"
|
const glfwDLLHash = "654e301e14362491530e1c9e2dde434d96eb5c6b11de42af62d85d9cc170f4d8"
|
||||||
|
@ -845,12 +845,7 @@ func (u *UserInterface) init() error {
|
|||||||
glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI)
|
glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable auto-iconifying on Windows until some fullscreen issues are solved (#1506).
|
glfw.WindowHint(glfw.AutoIconify, glfw.False)
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
glfw.WindowHint(glfw.AutoIconify, glfw.True)
|
|
||||||
} else {
|
|
||||||
glfw.WindowHint(glfw.AutoIconify, glfw.False)
|
|
||||||
}
|
|
||||||
|
|
||||||
decorated := glfw.False
|
decorated := glfw.False
|
||||||
if u.isInitWindowDecorated() {
|
if u.isInitWindowDecorated() {
|
||||||
|
Loading…
Reference in New Issue
Block a user