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 <Friedemann.Kleint@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
bb10
Olivier Goffart 2017-02-22 17:06:23 +01:00 committed by Olivier Goffart (Woboq GmbH)
parent 50ab231582
commit 886ce572d6
1 changed files with 3 additions and 0 deletions

View File

@ -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<RECT *>(lParam);
SetWindowPos(hwnd, NULL, prcNewWindow->left, prcNewWindow->top,