path: root/src/gui/kernel/qwindowsysteminterface.cpp
diff options
authorMorten Johan Sørvig <>2016-01-21 10:33:45 +0100
committerTor Arne Vestbø <>2017-07-11 15:25:00 +0000
commitecac1aeb29f37a080d4f2d3614bfc5fcc5b70689 (patch)
tree0bb1f62818a870e8f287558d56935762a6187a07 /src/gui/kernel/qwindowsysteminterface.cpp
parenta6991376cc4c7084a151272d7e27a5140597cc9e (diff)
Document expose event behavior
Document that "visible"-but-obscured windows may not get expose events for various audiences: QTestLib users, platform plugin authors and on the QExposeEvent itself. QWindow::exposeEvent() already has this documented and is not changed. Task-number: QTBUG-50414 Change-Id: I91042e8b1c70e48f10e692b2e80367d242a8ccbe Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 233c27dee7..e2087bd22f 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -303,6 +303,23 @@ QWindowSystemInterfacePrivate::ExposeEvent::ExposeEvent(QWindow *window, const Q
+/*! \internal
+ Handles an expose event.
+ The platform plugin sends expose events when an area of the window
+ is invalidated or window exposure changes. \a region is in window
+ local coordinates. An empty region indicates that the window is
+ obscured, but note that the exposed property of the QWindow will be set
+ based on what QPlatformWindow::isExposed() returns at the time of this call,
+ not based on what the region is. // FIXME: this should probably be fixed.
+ The platform plugin may omit sending expose events (or send obscure
+ events) for windows that are on screen but where the client area is
+ completely covered by other windows or otherwise not visible. Expose
+ event consumers can then use this to disable updates for such windows.
+ This is required behavior on platforms where OpenGL swapbuffers stops
+ blocking for obscured windows (like macOS).
QT_DEFINE_QPA_EVENT_HANDLER(void, handleExposeEvent, QWindow *window, const QRegion &region)
QWindowSystemInterfacePrivate::ExposeEvent *e =