diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-12-21 15:53:57 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-03-19 10:41:45 +0000 |
commit | dc753374478d751c7c124030429e90d058934f9f (patch) | |
tree | be3f084ec080764af5b5950e75931dc05cb3ffb1 | |
parent | 1320b2f64412f0d86bd09c66c22df845e13a94a1 (diff) |
Windows QPA: Make the expected screen be in sync with the geometry changes
When the window moves to a new screen then we should ensure the screen
is updated at that point with the new size so it can account for any
scaling changes.
This reverts f1ec81b543fe1d5090acff298e24faf10a7bac63.
Change-Id: I2be3aab677c4677841a07beaaf373f498483b320
Fixes: QTBUG-72504
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2c0ffc9b26..2abd1eef8b 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1758,15 +1758,12 @@ void QWindowsWindow::checkForScreenChanged() QPlatformScreen *currentScreen = screen(); const auto &screenManager = QWindowsContext::instance()->screenManager(); - // QTBUG-62971: When dragging a window by its border, detect by mouse position - // to prevent it from oscillating between screens when it resizes - const QWindowsScreen *newScreen = testFlag(ResizeMoveActive) - ? screenManager.screenAtDp(QWindowsCursor::mousePosition()) - : screenManager.screenForHwnd(m_data.hwnd); + const QWindowsScreen *newScreen = screenManager.screenForHwnd(m_data.hwnd); if (newScreen != nullptr && newScreen != currentScreen) { qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__ << ' ' << window() << " \"" << currentScreen->name() << "\"->\"" << newScreen->name() << '"'; + setFlag(SynchronousGeometryChangeEvent); QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); } } @@ -1785,11 +1782,14 @@ void QWindowsWindow::handleGeometryChange() fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true); } + const bool wasSync = testFlag(SynchronousGeometryChangeEvent); checkForScreenChanged(); if (testFlag(SynchronousGeometryChangeEvent)) QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); + if (!wasSync) + clearFlag(SynchronousGeometryChangeEvent); qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry; } |