mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
Fix Win32 window size event race condition
The old window size was reported after re-entering full screen and setting and reporting the new window size. Fixes #740.
This commit is contained in:
parent
11d051b69a
commit
e640d840b7
@ -110,6 +110,8 @@ does not find Doxygen, the documentation will not be generated.
|
||||
trigger monitor callback
|
||||
- [Win32] Bugfix: No monitors were listed on headless and VMware guest systems
|
||||
- [Win32] Bugfix: Pressing Ctrl+Pause would report `GLFW_KEY_UNKNOWN`
|
||||
- [Win32] Bugfix: Window size events would be reported in wrong order when
|
||||
restoring a full screen window
|
||||
- [Cocoa] Made joystick polling more efficient
|
||||
- [Cocoa] Removed support for OS X 10.6
|
||||
- [Cocoa] Bugfix: Full screen windows on secondary monitors were mispositioned
|
||||
|
@ -613,32 +613,39 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
||||
|
||||
case WM_SIZE:
|
||||
{
|
||||
const GLFWbool iconified =
|
||||
!window->win32.iconified && wParam == SIZE_MINIMIZED;
|
||||
const GLFWbool restored =
|
||||
window->win32.iconified &&
|
||||
(wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED);
|
||||
|
||||
if (_glfw.cursorWindow == window)
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
updateClipRect(window);
|
||||
}
|
||||
|
||||
if (!window->win32.iconified && wParam == SIZE_MINIMIZED)
|
||||
if (iconified)
|
||||
_glfwInputWindowIconify(window, GLFW_TRUE);
|
||||
else if (restored)
|
||||
_glfwInputWindowIconify(window, GLFW_FALSE);
|
||||
|
||||
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
|
||||
_glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam));
|
||||
|
||||
if (iconified)
|
||||
{
|
||||
window->win32.iconified = GLFW_TRUE;
|
||||
if (window->monitor)
|
||||
releaseMonitor(window);
|
||||
|
||||
_glfwInputWindowIconify(window, GLFW_TRUE);
|
||||
}
|
||||
else if (window->win32.iconified &&
|
||||
(wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED))
|
||||
else if (restored)
|
||||
{
|
||||
window->win32.iconified = GLFW_FALSE;
|
||||
if (window->monitor)
|
||||
acquireMonitor(window);
|
||||
|
||||
_glfwInputWindowIconify(window, GLFW_FALSE);
|
||||
}
|
||||
|
||||
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam));
|
||||
_glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user