diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2012-10-09 10:52:44 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-17 09:39:01 +0200 |
commit | d6588d20518e6e33fdd5433d8af733657060b11e (patch) | |
tree | ffb5bcde2eec08a9cb0e4a3122c2efdcf362e822 /src/plugins/platforms/windows | |
parent | c5b766638ac8cef1acebb97d5952485f5dc846ad (diff) |
QPlatformWindow: change API for QPlatformWindow::setWindowState
The current implementation requests the platform window to set
the window state if it can, and return the actual window state
back.
The problem with this approach is that the platform window is created
as late as possible, so a call to QWindow::setWindowState would in
many (most?) cases never be forwarded to the platform window (instead,
the platform window is responsible to check the current window state
upon creation). As such, the window state might be left unsynched with
the platform window.
This patch suggests removing the return value from
QPlatformWindow::setWindowState. This will at least be consistent, so
that setting/getting state would produce the same result independent of
delayed window creation. If needed, we can later add new API to
QPlatformIntegration or QPlatformWindow for querying supported/actual
window state.
Change-Id: Ie43f56169656854a765ce88b47a808f8f3d51bb4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index a31b09d2bf..fc3566660a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1235,13 +1235,12 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state) QWindowSystemInterface::handleWindowStateChanged(window(), state); } -Qt::WindowState QWindowsWindow::setWindowState(Qt::WindowState state) +void QWindowsWindow::setWindowState(Qt::WindowState state) { if (m_data.hwnd) { setWindowState_sys(state); m_windowState = state; } - return state; } bool QWindowsWindow::isFullScreen_sys() const diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 5d898a2d41..978d1d5a53 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -160,7 +160,7 @@ public: virtual QPoint mapFromGlobal(const QPoint &pos) const; virtual void setWindowFlags(Qt::WindowFlags flags); - virtual Qt::WindowState setWindowState(Qt::WindowState state); + virtual void setWindowState(Qt::WindowState state); HWND handle() const { return m_data.hwnd; } |