diff --git a/.gitignore b/.gitignore index 96d5ba3f6..9d6d4c09c 100644 --- a/.gitignore +++ b/.gitignore @@ -83,3 +83,4 @@ tests/title tests/triangle-vulkan tests/windows +/[Bb]uild*/ diff --git a/src/win32_window.c b/src/win32_window.c index 24966bf41..a48697d89 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1741,8 +1741,13 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, acquireMonitor(window); + HWND z_mode = HWND_TOP; + if (window->floating) { + z_mode = HWND_TOPMOST; + } + GetMonitorInfo(window->monitor->win32.handle, &mi); - SetWindowPos(window->win32.handle, HWND_TOPMOST, + SetWindowPos(window->win32.handle, z_mode, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right - mi.rcMonitor.left,