mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 14:24:35 +00:00
Cleanup.
This commit is contained in:
parent
e11a5e3973
commit
3be3f58a92
@ -1010,20 +1010,6 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
|||||||
|
|
||||||
void _glfwPlatformSetWindowSize(_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)
|
if (window->monitor)
|
||||||
{
|
{
|
||||||
_glfwSetVideoMode(window->monitor, &window->videoMode);
|
_glfwSetVideoMode(window->monitor, &window->videoMode);
|
||||||
@ -1037,7 +1023,23 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
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);
|
XResizeWindow(_glfw.x11.display, window->x11.handle, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
XFlush(_glfw.x11.display);
|
XFlush(_glfw.x11.display);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user