Camilla Berglund 12 年之前
父節點
當前提交
3be3f58a92
共有 1 個文件被更改,包括 16 次插入14 次删除
  1. 16 14
      src/x11_window.c

+ 16 - 14
src/x11_window.c

@@ -1010,20 +1010,6 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
 
 void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
 {
-    if (!window->resizable)
-    {
-        // Update window size restrictions to match new window size
-
-        XSizeHints* hints = XAllocSizeHints();
-
-        hints->flags |= (PMinSize | PMaxSize);
-        hints->min_width  = hints->max_width  = width;
-        hints->min_height = hints->max_height = height;
-
-        XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints);
-        XFree(hints);
-    }
-
     if (window->monitor)
     {
         _glfwSetVideoMode(window->monitor, &window->videoMode);
@@ -1037,7 +1023,23 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
         }
     }
     else
+    {
+        if (!window->resizable)
+        {
+            // Update window size restrictions to match new window size
+
+            XSizeHints* hints = XAllocSizeHints();
+
+            hints->flags |= (PMinSize | PMaxSize);
+            hints->min_width  = hints->max_width  = width;
+            hints->min_height = hints->max_height = height;
+
+            XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints);
+            XFree(hints);
+        }
+
         XResizeWindow(_glfw.x11.display, window->x11.handle, width, height);
+    }
 
     XFlush(_glfw.x11.display);
 }