mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Fixed resize mode setting on Windows.
This commit is contained in:
parent
71d2b574f8
commit
0356aa620d
@ -929,37 +929,23 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
|||||||
|
|
||||||
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||||
{
|
{
|
||||||
GLboolean sizeChanged = GL_FALSE;
|
|
||||||
|
|
||||||
if (window->monitor)
|
if (window->monitor)
|
||||||
{
|
{
|
||||||
GLFWvidmode mode;
|
GLFWvidmode mode;
|
||||||
|
_glfwSetVideoMode(window->monitor, &window->videoMode);
|
||||||
_glfwPlatformGetVideoMode(window->monitor, &mode);
|
_glfwPlatformGetVideoMode(window->monitor, &mode);
|
||||||
|
|
||||||
if (width > mode.width || height > mode.height)
|
SetWindowPos(window->win32.handle, HWND_TOP,
|
||||||
{
|
0, 0, mode.width, mode.height,
|
||||||
// The new video mode is larger than the current one, so we resize
|
SWP_NOMOVE);
|
||||||
// the window before switch modes to avoid exposing whatever is
|
|
||||||
// underneath
|
|
||||||
|
|
||||||
SetWindowPos(window->win32.handle, HWND_TOP, 0, 0, width, height,
|
|
||||||
SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER);
|
|
||||||
sizeChanged = GL_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Change video mode
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If we are in windowed mode, adjust the window size to
|
int fullWidth, fullHeight;
|
||||||
// compensate for window decorations
|
getFullWindowSize(window, width, height, &fullWidth, &fullHeight);
|
||||||
getFullWindowSize(window, width, height, &width, &height);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set window size (if we haven't already)
|
SetWindowPos(window->win32.handle, HWND_TOP,
|
||||||
if (!sizeChanged)
|
0, 0, fullWidth, fullHeight,
|
||||||
{
|
|
||||||
SetWindowPos(window->win32.handle, HWND_TOP, 0, 0, width, height,
|
|
||||||
SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER);
|
SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user