From 529cfe4e22cc02dc7c29f653e8ff23656aa16ff9 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 21 Feb 2020 09:10:28 +0100 Subject: qwindowswindow: Fix screen changes between different DPI screens for native windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When asynchronous events are used for notifications about screen changes it is possible that we run into a race condition where the scale factor has not yet been updated for the new screen. This results in a wrong geometry being set for the window that is moved between the screens. We do not have that problem with synchronous events. Change-Id: I4eb6d2a7cb49517d271901b479f973e273a0926a Amends: 7eed1e40d4d3b6a066bac52995eed7e75d17de2d Task-number: QTBUG-65580 Fixes: QTBUG-82312 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/windows/qwindowswindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 496b18ba1a..a11da598fc 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1943,10 +1943,8 @@ void QWindowsWindow::checkForScreenChanged(ScreenChangeMode mode) qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__ << ' ' << window() << " \"" << (currentScreen ? currentScreen->name() : QString()) << "\"->\"" << newScreen->name() << '"'; - if (mode == FromGeometryChange) - setFlag(SynchronousGeometryChangeEvent); updateFullFrameMargins(); - QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); + QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); } void QWindowsWindow::handleGeometryChange() -- cgit v1.2.3