Browse Source

Win32: Remove double resize of full screen window

Related to #1085.
Camilla Löwy 7 years ago
parent
commit
d630684654
2 changed files with 7 additions and 13 deletions
  1. 1 0
      README.md
  2. 6 13
      src/win32_window.c

+ 1 - 0
README.md

@@ -204,6 +204,7 @@ information on what to include when reporting a bug.
                   (#650,#1071)
                   (#650,#1071)
 - [Win32] Bugfix: Returned key names did not match other platforms (#943)
 - [Win32] Bugfix: Returned key names did not match other platforms (#943)
 - [Win32] Bugfix: Undecorated windows did not maximize to workarea (#899)
 - [Win32] Bugfix: Undecorated windows did not maximize to workarea (#899)
+- [Win32] Bugfix: Window was resized twice when entering full screen (#1085)
 - [X11] Moved to XI2 `XI_RawMotion` for disable cursor mode motion input (#125)
 - [X11] Moved to XI2 `XI_RawMotion` for disable cursor mode motion input (#125)
 - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
 - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
 - [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X
 - [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X

+ 6 - 13
src/win32_window.c

@@ -1497,26 +1497,19 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
 
 
     if (monitor)
     if (monitor)
     {
     {
-        GLFWvidmode mode;
-        DWORD style = GetWindowLongW(window->win32.handle, GWL_STYLE);
-        UINT flags = SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOCOPYBITS;
-
         if (window->decorated)
         if (window->decorated)
         {
         {
+            DWORD style = GetWindowLongW(window->win32.handle, GWL_STYLE);
+            UINT flags = SWP_FRAMECHANGED | SWP_SHOWWINDOW |
+                         SWP_NOACTIVATE | SWP_NOCOPYBITS |
+                         SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE;
+
             style &= ~WS_OVERLAPPEDWINDOW;
             style &= ~WS_OVERLAPPEDWINDOW;
             style |= getWindowStyle(window);
             style |= getWindowStyle(window);
             SetWindowLongW(window->win32.handle, GWL_STYLE, style);
             SetWindowLongW(window->win32.handle, GWL_STYLE, style);
-
-            flags |= SWP_FRAMECHANGED;
+            SetWindowPos(window->win32.handle, HWND_TOPMOST, 0, 0, 0, 0, flags);
         }
         }
 
 
-        _glfwPlatformGetVideoMode(monitor, &mode);
-        _glfwPlatformGetMonitorPos(monitor, &xpos, &ypos);
-
-        SetWindowPos(window->win32.handle, HWND_TOPMOST,
-                     xpos, ypos, mode.width, mode.height,
-                     flags);
-
         acquireMonitor(window);
         acquireMonitor(window);
     }
     }
     else
     else