Skip to content

Commit

Permalink
Call screenForHwnd before condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Oct 15, 2024
1 parent 7a65cb8 commit 412f65c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion qtbase_5.15.15/0027-backport-dpi-change-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ index 5c095808f2..c22c5ca50b 100644
static bool isSingleScreen();

diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 9d9180e4f5..8a923a052f 100644
index 9d9180e4f5..18b24de878 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1942,9 +1942,9 @@ void QWindowsWindow::checkForScreenChanged(ScreenChangeMode mode)
Expand All @@ -243,6 +243,21 @@ index 9d9180e4f5..8a923a052f 100644
if (newScreen == nullptr || newScreen == currentScreen)
return;
// For screens with different DPI: postpone until WM_DPICHANGE
@@ -1964,9 +1964,11 @@ void QWindowsWindow::handleGeometryChange()
{
const QRect previousGeometry = m_data.geometry;
m_data.geometry = geometry_sys();
- if (testFlag(WithinDpiChanged)
- && QWindowsContext::instance()->screenManager().screenForHwnd(m_data.hwnd) != screen()) {
- return; // QGuiApplication will send resize when screen actually changes
+ if (testFlag(WithinDpiChanged)) {
+ const QWindowsScreen *newScreen =
+ QWindowsContext::instance()->screenManager().screenForHwnd(m_data.hwnd);
+ if (newScreen != screen())
+ return; // QGuiApplication will send resize when screen actually changes
}
QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry);
// QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index ac207aa48f..27d467c3c6 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
Expand Down

0 comments on commit 412f65c

Please sign in to comment.