diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-05-21 13:04:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 12:49:39 +0200 |
commit | 8078a04e1950d1e9957c3b3c3ea8e6e0c3d34b80 (patch) | |
tree | 2b3b241171a0c54c190d6ad34d32394698ee31cc /src/plugins/platforms | |
parent | b94fe52f85056ec7c597458aa5e2884de06f4a1b (diff) |
Observe initial screen for fullscreen windows.
Introduce flag to determine "create" state and do
not try to determine the screen from the geometry.
Fixes breakage introduced by
ded4613ae43842d4b960137843eb83a7472adc65.
Task-number: QTBUG-31166
Task-number: QTBUG-30724
Change-Id: Ibe8df95e0ea84be070fdd06b158a6a10c76d42be
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 010197d6d8..a5776e7c4e 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -775,7 +775,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : QPlatformWindow(aWindow), m_data(data), - m_flags(0), + m_flags(WithinCreate), m_hdc(0), m_windowState(Qt::WindowNoState), m_opacity(1.0), @@ -826,6 +826,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : const qreal opacity = qt_window_private(aWindow)->opacity; if (!qFuzzyCompare(opacity, qreal(1.0))) setOpacity(opacity); + clearFlag(WithinCreate); } QWindowsWindow::~QWindowsWindow() @@ -1481,8 +1482,10 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState) if (visible) newStyle |= WS_VISIBLE; setStyle(newStyle); - - const QRect r = effectiveScreen(window())->geometry(); + // Use geometry of QWindow::screen() within creation or the virtual screen the + // window is in (QTBUG-31166, QTBUG-30724). + const QScreen *screen = testFlag(WithinCreate) ? window()->screen() : effectiveScreen(window()); + const QRect r = screen->geometry(); const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE; const bool wasSync = testFlag(SynchronousGeometryChangeEvent); setFlag(SynchronousGeometryChangeEvent); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 6c735ede7d..07f3976d87 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -134,7 +134,8 @@ public: WithinDestroy = 0x1000, TouchRegistered = 0x2000, AlertState = 0x4000, - Exposed = 0x08000 + Exposed = 0x08000, + WithinCreate = 0x10000 }; struct WindowData |