From 7aedf7703fdf24c11375b7e67c2a6d9e16b0008b Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 22 Jun 2022 20:23:24 +0400 Subject: [PATCH] Revert "Make window resize less lagged on Windows" This reverts commit b5da6e709d835de8920d11516143a7c01c7c2aa7. --- ui/platform/win/ui_window_win.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/ui/platform/win/ui_window_win.cpp b/ui/platform/win/ui_window_win.cpp index 1ad1454..9357993 100644 --- a/ui/platform/win/ui_window_win.cpp +++ b/ui/platform/win/ui_window_win.cpp @@ -198,18 +198,6 @@ void WindowHelper::setNativeFrame(bool enabled) { updateMargins(); updateWindowFrameColors(); fixMaximizedWindow(); - SetWindowPos( - _handle, - 0, - 0, - 0, - 0, - 0, - SWP_FRAMECHANGED - | SWP_NOMOVE - | SWP_NOSIZE - | SWP_NOZORDER - | SWP_NOACTIVATE); } void WindowHelper::initialShadowUpdate() { @@ -388,14 +376,17 @@ bool WindowHelper::handleNativeEvent( } return true; case WM_NCCALCSIZE: { - if (_title->isHidden() || !wParam) { + if (_title->isHidden()) { return false; } WINDOWPLACEMENT wp; wp.length = sizeof(WINDOWPLACEMENT); if (GetWindowPlacement(_handle, &wp) && (wp.showCmd == SW_SHOWMAXIMIZED)) { - const auto r = &((LPNCCALCSIZE_PARAMS)lParam)->rgrc[0]; + const auto params = (LPNCCALCSIZE_PARAMS)lParam; + const auto r = (wParam == TRUE) + ? ¶ms->rgrc[0] + : (LPRECT)lParam; const auto hMonitor = MonitorFromPoint( { (r->left + r->right) / 2, (r->top + r->bottom) / 2 }, MONITOR_DEFAULTTONEAREST); @@ -415,10 +406,8 @@ bool WindowHelper::handleNativeEvent( } } } - if (result) *result = 0; - } else { - if (result) *result = WVR_REDRAW; } + if (result) *result = 0; return true; }