From bd70e5335207fc45e56f045f843d86bdd32601f3 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sat, 8 Sep 2012 21:08:39 +0200 Subject: [PATCH] Added missing flags for size hints. --- readme.html | 1 + src/x11_window.c | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.html b/readme.html index 314c392a..31e9217e 100644 --- a/readme.html +++ b/readme.html @@ -349,6 +349,7 @@ version of GLFW.

  • [X11] Bugfix: Some window properties required by the ICCCM were not set
  • [X11] Bugfix: Calling glXCreateContextAttribsARB with an unavailable OpenGL version caused the application to terminate with a BadMatch Xlib error
  • [X11] Bugfix: A synchronization point necessary for jitter-free locked cursor mode was incorrectly removed
  • +
  • [X11] Bugfix: The window size hints were not updated when calling glfwSetWindowSize on a non-resizable window
  • [Win32] Changed port to use Unicode mode only
  • [Win32] Removed explicit support for versions of Windows older than Windows XP
  • [Win32] Bugfix: Window activation and iconification did not work as expected
  • diff --git a/src/x11_window.c b/src/x11_window.c index f219275c..cbc28dd0 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -956,7 +956,6 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) { int mode = 0, rate, sizeChanged = GL_FALSE; - XSizeHints* sizehints; rate = window->refreshRate; @@ -970,14 +969,14 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) { // Update window size restrictions to match new window size - sizehints = XAllocSizeHints(); - sizehints->flags = 0; + XSizeHints* hints = XAllocSizeHints(); - sizehints->min_width = sizehints->max_width = width; - sizehints->min_height = sizehints->max_height = height; + hints->flags |= (PMinSize | PMaxSize); + hints->min_width = hints->max_width = width; + hints->min_height = hints->max_height = height; - XSetWMNormalHints(_glfwLibrary.X11.display, window->X11.handle, sizehints); - XFree(sizehints); + XSetWMNormalHints(_glfwLibrary.X11.display, window->X11.handle, hints); + XFree(hints); } // Change window size before changing fullscreen mode?