diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-10-29 12:39:00 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-29 15:22:34 +0000 |
commit | 91b24b236d72e7266da43d46c308a19b1550f0fc (patch) | |
tree | 6572c93d345ebabb8727fc484f457eb6f4908c81 /src | |
parent | c2a554466c090c568e5d329dc2ec2e402c5c9f10 (diff) |
windows qpa: re-apply 8d6e825d
“Handle invisible child windows gracefully on dpi changes”
This fix was accidentally removed by commit cd96d870
“Move VM_DPICHANGE handling to QWindowsWindow”.
Fixes: QTBUG-96466
Change-Id: I3774f6305631ba47282d43e8480e2acaba517a96
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit e7371fa1592cf490eab6cb82bc06ed67c7d154e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 682ce8f710..1889396060 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1888,6 +1888,8 @@ void QWindowsWindow::handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam) // Scale child QPlatformWindow size. Windows sends WM_DPICHANGE to top-level windows only. for (QWindow *childWindow : window()->findChildren<QWindow *>()) { QWindowsWindow *platformChildWindow = static_cast<QWindowsWindow *>(childWindow->handle()); + if (!platformChildWindow) + continue; QRect currentGeometry = platformChildWindow->geometry(); QRect scaledGeometry = QRect(currentGeometry.topLeft() * scale, currentGeometry.size() * scale); platformChildWindow->setGeometry(scaledGeometry); |