From 2e4d8f67a871f2033abeb08cf94d8a31a14ad1cc Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 17 Feb 2012 11:30:56 +0100 Subject: Introduced QWindow::isExposed(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The visible property along with show/hideEvent tracks the windows visibility from the application perspective and is really a request. The exposeEvent() along with the isExposed() accessor is used to notify the application of the actual state of the window in the windowing system. Change-Id: I7f5b7ed74a168e34aaa21ce0ae9042ddfb0bf6d8 Reviewed-by: Samuel Rødal --- src/gui/kernel/qplatformwindow_qpa.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gui/kernel/qplatformwindow_qpa.cpp') diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index c52a1cf757..f3f0a55862 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -142,6 +142,7 @@ QMargins QPlatformWindow::frameMargins() const void QPlatformWindow::setVisible(bool visible) { Q_UNUSED(visible); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size())); } /*! Requests setting the window flags of this surface @@ -152,6 +153,20 @@ Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags) return flags; } + + +/*! + Returns if this window is exposed in the windowing system. + + An exposeEvent() is sent every time this value changes. + */ + +bool QPlatformWindow::isExposed() const +{ + Q_D(const QPlatformWindow); + return d->window->visible(); +} + /*! Requests setting the window state of this surface to \a type. Returns the actual state set. -- cgit v1.2.3 From b0a803213ebd1f7bdf9c40070e14a209d96b7e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 17 Feb 2012 16:58:09 +0100 Subject: Added note in QPlatformWindow::setGeometry() docs about position policy. Change-Id: I0ac76b7aac1aa717592c34f414b1dd8fbee92be2 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qplatformwindow_qpa.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/kernel/qplatformwindow_qpa.cpp') diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index f3f0a55862..e12228d7bd 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -114,6 +114,10 @@ QSurfaceFormat QPlatformWindow::format() const can happen programatically(from ie. user application) or by the window manager. This means that there is no need to call this function specifically from the window manager callback, instead call QWindowSystemInterface::handleGeometryChange(QWindow *w, const QRect &newRect); + + The position(x, y) part of the rect might be inclusive or exclusive of the window frame + as returned by frameMargins(). You can detect this in the plugin by checking + qt_window_private(window())->positionPolicy. */ void QPlatformWindow::setGeometry(const QRect &rect) { -- cgit v1.2.3