QPlatformWindow: change API for QPlatformWindow::setWindowState
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>
Tue, 9 Oct 2012 08:52:44 +0000 (10:52 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 17 Oct 2012 07:39:01 +0000 (09:39 +0200)
commitd6588d20518e6e33fdd5433d8af733657060b11e
treeffb5bcde2eec08a9cb0e4a3122c2efdcf362e822
parentc5b766638ac8cef1acebb97d5952485f5dc846ad
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>
15 files changed:
src/gui/kernel/qplatformwindow.cpp
src/gui/kernel/qplatformwindow.h
src/gui/kernel/qwindow.cpp
src/plugins/platforms/cocoa/qcocoawindow.h
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/eglfs/qeglfswindow.cpp
src/plugins/platforms/eglfs/qeglfswindow.h
src/plugins/platforms/qnx/qqnxwindow.cpp
src/plugins/platforms/qnx/qqnxwindow.h
src/plugins/platforms/windows/qwindowswindow.cpp
src/plugins/platforms/windows/qwindowswindow.h
src/plugins/platforms/xcb/qxcbwindow.cpp
src/plugins/platforms/xcb/qxcbwindow.h
src/widgets/kernel/qwidget_p.h
src/widgets/kernel/qwidget_qpa.cpp