From f4e36e53897f14afa257f6d2eed7793366fd2251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 21 Apr 2022 21:22:24 +0200 Subject: [PATCH] Win32: Make monitor area retrieval more consistent The rest of this file uses GetMonitorInfoW to retrieve this information. (cherry picked from commit 7dfd84c458dfa12b351c932b8281b13faf7b50b9) --- src/win32_window.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/win32_window.c b/src/win32_window.c index ca0f355d..7a32bf8c 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1280,15 +1280,16 @@ static int createNativeWindow(_GLFWwindow* window, if (window->monitor) { - GLFWvidmode mode; + MONITORINFO mi = { sizeof(mi) }; + GetMonitorInfoW(window->monitor->win32.handle, &mi); // NOTE: This window placement is temporary and approximate, as the // correct position and size cannot be known until the monitor // video mode has been picked in _glfwSetVideoModeWin32 - _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); - _glfwPlatformGetVideoMode(window->monitor, &mode); - fullWidth = mode.width; - fullHeight = mode.height; + xpos = mi.rcMonitor.left; + ypos = mi.rcMonitor.top; + fullWidth = mi.rcMonitor.right - mi.rcMonitor.left; + fullHeight = mi.rcMonitor.bottom - mi.rcMonitor.top; } else {