From 886ce572d628e7cd98cc39edcc930ffae951e95e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 22 Feb 2017 17:06:23 +0100 Subject: Windows QPA: don't resize fixed sized windows when changing screen This seems to give pretty good result when EnableHighDPIScaling is NOT set. But this seems to be worse when it's set. Task-number: QTBUG-58959 Change-Id: I8de5a6c3c8b6146b1cb8f89676463206af404083 Reviewed-by: Friedemann Kleint Reviewed-by: Anton Kudryavtsev --- src/plugins/platforms/windows/qwindowscontext.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index b7a866679f..ff4ab1accb 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1104,6 +1104,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, #endif } break; case QtWindows::DpiChangedEvent: { + if (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_DLGFRAME) + return false; // Fixed-size window should not be resized + platformWindow->setFlag(QWindowsWindow::WithinDpiChanged); const RECT *prcNewWindow = reinterpret_cast(lParam); SetWindowPos(hwnd, NULL, prcNewWindow->left, prcNewWindow->top, -- cgit v1.2.3