diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-14 08:09:04 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-15 05:39:07 +0000 |
commit | c92fedd761206231f13838528943619b84df55bf (patch) | |
tree | 8387d1a4a07466a5b83c15a6a13ee2d6dbdc29e4 /src/plugins/platforms/windows | |
parent | 5e3b32b60813cbdb4ceba42d33a9b7738e313cbf (diff) |
Windows QPA: Fix restoring from fullscreen in High DPI setups
The logic for checking whether the saved geometry (native pixels)
is still within a screen compared them against logical coordinates.
Work with the platform screen geometry instead.
Fixes: QTBUG-83448
Change-Id: Ib68f967d1a33a490f88a7bec6dcc788788a10389
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 322eae7a06..01f6bef42e 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2287,8 +2287,10 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState) if (!screen) screen = QGuiApplication::primaryScreen(); // That area of the virtual desktop might not be covered by a screen anymore. - if (!screen->geometry().intersects(m_savedFrameGeometry)) - m_savedFrameGeometry.moveTo(screen->geometry().topLeft()); + if (const auto platformScreen = screen->handle()) { + if (!platformScreen->geometry().intersects(m_savedFrameGeometry)) + m_savedFrameGeometry.moveTo(platformScreen->geometry().topLeft()); + } if (newState & Qt::WindowMinimized) { setMinimizedGeometry(m_data.hwnd, m_savedFrameGeometry); |