Safer window resize on Windows - don't updating the backbuffer size until stopped dragging.

Cherry-picked from the Vulkan branch.
This commit is contained in:
Henrik Rydgard 2016-02-21 11:50:37 +01:00
parent 76e1d074ec
commit 6b829c9cde

View file

@ -118,6 +118,7 @@ namespace MainWindow
static bool hideCursor = false;
static int g_WindowState;
static bool g_IgnoreWM_SIZE = false;
static bool inResizeMove = false;
// gross hack
bool noFocusPause = false; // TOGGLE_PAUSE state to override pause on lost focus
@ -701,13 +702,22 @@ namespace MainWindow
SavePosition();
break;
case WM_ENTERSIZEMOVE:
inResizeMove = true;
break;
case WM_EXITSIZEMOVE:
inResizeMove = false;
HandleSizeChange(SIZE_RESTORED);
break;
case WM_SIZE:
switch (wParam) {
case SIZE_RESTORED:
case SIZE_MAXIMIZED:
if (g_IgnoreWM_SIZE) {
return DefWindowProc(hWnd, message, wParam, lParam);
} else {
} else if (!inResizeMove) {
HandleSizeChange(wParam);
}
break;