Differential D20607 Diff 56529 3rdparty/ext_qt/0030-Windows-QPA-Make-the-expected-screen-be-in-sync-with.patch
Changeset View
Changeset View
Standalone View
Standalone View
3rdparty/ext_qt/0030-Windows-QPA-Make-the-expected-screen-be-in-sync-with.patch
- This file was added.
1 | From e553433c3dfa2664140a2ccf4b479821fc382e83 Mon Sep 17 00:00:00 2001 | ||||
---|---|---|---|---|---|
2 | From: Andy Shaw <andy.shaw@qt.io> | ||||
3 | Date: Fri, 21 Dec 2018 15:53:57 +0100 | ||||
4 | Subject: [PATCH 30/36] Windows QPA: Make the expected screen be in sync with | ||||
5 | the geometry changes | ||||
6 | | ||||
7 | When the window moves to a new screen then we should ensure the screen | ||||
8 | is updated at that point with the new size so it can account for any | ||||
9 | scaling changes. | ||||
10 | | ||||
11 | This reverts f1ec81b543fe1d5090acff298e24faf10a7bac63. | ||||
12 | | ||||
13 | Change-Id: I2be3aab677c4677841a07beaaf373f498483b320 | ||||
14 | Fixes: QTBUG-72504 | ||||
15 | Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> | ||||
16 | --- | ||||
17 | src/plugins/platforms/windows/qwindowswindow.cpp | 10 +++++----- | ||||
18 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||||
19 | | ||||
20 | diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp | ||||
21 | index 910d8dd209..865874846e 100644 | ||||
22 | --- a/src/plugins/platforms/windows/qwindowswindow.cpp | ||||
23 | +++ b/src/plugins/platforms/windows/qwindowswindow.cpp | ||||
24 | @@ -1756,15 +1756,12 @@ void QWindowsWindow::checkForScreenChanged() | ||||
25 | | ||||
26 | QPlatformScreen *currentScreen = screen(); | ||||
27 | const auto &screenManager = QWindowsContext::instance()->screenManager(); | ||||
28 | - // QTBUG-62971: When dragging a window by its border, detect by mouse position | ||||
29 | - // to prevent it from oscillating between screens when it resizes | ||||
30 | - const QWindowsScreen *newScreen = testFlag(ResizeMoveActive) | ||||
31 | - ? screenManager.screenAtDp(QWindowsCursor::mousePosition()) | ||||
32 | - : screenManager.screenForHwnd(m_data.hwnd); | ||||
33 | + const QWindowsScreen *newScreen = screenManager.screenForHwnd(m_data.hwnd); | ||||
34 | if (newScreen != nullptr && newScreen != currentScreen) { | ||||
35 | qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__ | ||||
36 | << ' ' << window() << " \"" << currentScreen->name() | ||||
37 | << "\"->\"" << newScreen->name() << '"'; | ||||
38 | + setFlag(SynchronousGeometryChangeEvent); | ||||
39 | QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen()); | ||||
40 | } | ||||
41 | } | ||||
42 | @@ -1783,11 +1780,14 @@ void QWindowsWindow::handleGeometryChange() | ||||
43 | fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true); | ||||
44 | } | ||||
45 | | ||||
46 | + const bool wasSync = testFlag(SynchronousGeometryChangeEvent); | ||||
47 | checkForScreenChanged(); | ||||
48 | | ||||
49 | if (testFlag(SynchronousGeometryChangeEvent)) | ||||
50 | QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents); | ||||
51 | | ||||
52 | + if (!wasSync) | ||||
53 | + clearFlag(SynchronousGeometryChangeEvent); | ||||
54 | qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry; | ||||
55 | } | ||||
56 | | ||||
57 | -- | ||||
58 | 2.18.0.windows.1 | ||||
59 | |