windows qpa: Handle invisible child windows gracefully on dpi changes
Fixes: QTBUG-96466 Pick-to: 6.2 Change-Id: I58d90e85b4bb837df2dc5fd89abe984dadcd468d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
95ef193715
commit
8d6e825ddf
@ -1474,6 +1474,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
|||||||
// Scale child QPlatformWindow size. Windows sends WM_DPICHANGE to top-level windows only.
|
// Scale child QPlatformWindow size. Windows sends WM_DPICHANGE to top-level windows only.
|
||||||
for (QWindow *childWindow : platformWindow->window()->findChildren<QWindow *>()) {
|
for (QWindow *childWindow : platformWindow->window()->findChildren<QWindow *>()) {
|
||||||
QWindowsWindow *platformChildWindow = static_cast<QWindowsWindow *>(childWindow->handle());
|
QWindowsWindow *platformChildWindow = static_cast<QWindowsWindow *>(childWindow->handle());
|
||||||
|
if (!platformChildWindow)
|
||||||
|
continue;
|
||||||
QRect currentGeometry = platformChildWindow->geometry();
|
QRect currentGeometry = platformChildWindow->geometry();
|
||||||
QRect scaledGeometry = QRect(currentGeometry.topLeft() * scale, currentGeometry.size() * scale);
|
QRect scaledGeometry = QRect(currentGeometry.topLeft() * scale, currentGeometry.size() * scale);
|
||||||
platformChildWindow->setGeometry(scaledGeometry);
|
platformChildWindow->setGeometry(scaledGeometry);
|
||||||
|
Loading…
Reference in New Issue
Block a user