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:
parent
76e1d074ec
commit
6b829c9cde
1 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue