Fixes #740 - size callbacks incorrect on monitor orientation change in windows

This commit is contained in:
Doug Binks 2016-04-18 12:17:06 +01:00
parent e2d5071e59
commit 781b6d7f69

View File

@ -637,8 +637,17 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
_glfwInputWindowIconify(window, GLFW_FALSE); _glfwInputWindowIconify(window, GLFW_FALSE);
} }
_glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam)); // WM_SIZE params do not appear to catch display orientation
_glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam)); // changes correctly, so use Get functions to retreive.
// Both framebuffer and window sizes are the same, but get both
// here for potential future proofing.
int fbwidth, fbheight;
_glfwPlatformGetFramebufferSize(window, &fbwidth, &fbheight);
_glfwInputFramebufferSize(window, fbwidth, fbheight);
int wwidth, wheight;
_glfwPlatformGetWindowSize(window, &wwidth, &wheight);
_glfwInputWindowSize(window, wwidth, wheight);
return 0; return 0;
} }