summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-02-17 11:30:56 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-18 20:45:23 +0100
commit2e4d8f67a871f2033abeb08cf94d8a31a14ad1cc (patch)
tree085f41995e906b8624adf3f1d455863f2edb1c45 /src/gui/kernel/qwindow.cpp
parent466107107a85e7211c4b7f77b36ec50625657061 (diff)
Introduced QWindow::isExposed().
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 <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 96fb394643..5b6ee0e9cb 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -374,6 +374,25 @@ void QWindow::requestActivateWindow()
d->platformWindow->requestActivateWindow();
}
+
+/*!
+ Returns if this window is exposed in the windowing system.
+
+ When the window is not exposed, it is shown by the application
+ but it is still not showing in the windowing system, so the application
+ should minimize rendering and other graphical activities.
+
+ An exposeEvent() is sent every time this value changes.
+ */
+
+bool QWindow::isExposed() const
+{
+ Q_D(const QWindow);
+ if (d->platformWindow)
+ return d->platformWindow->isExposed();
+ return false;
+}
+
/*!
Returns true if the window should appear active from a style perspective.
@@ -888,6 +907,19 @@ bool QWindow::close()
return true;
}
+
+
+/*!
+ The expose event is sent by the window system whenever the window's
+ exposure on screen changes.
+
+ If the window is moved off screen, is made totally obscured by another
+ window, iconified or similar, this function might be called and the
+ value of isExposed() might change to false. When this happens,
+ an application should stop its rendering as it is no longer visible
+ to the user.
+ */
+
void QWindow::exposeEvent(QExposeEvent *ev)
{
ev->ignore();