diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-09-22 09:02:40 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-23 11:30:54 +0200 |
commit | 5fb67c1dacce58c034980c5c559f74ce9ec2c756 (patch) | |
tree | a5de3ab3a0054f00dd4669ac59438cde0b517728 /src/plugins | |
parent | 078d7018199eee1cb2850f077f12aa95bf328e44 (diff) |
Don't flood expose events in the xcb plugin.
The X server sends a series of expose events, where the count member
specifies how many expose events are remaining in the current series. By
merging them into an expose region we can send a single expose event to
the lighthouse interface.
Change-Id: If73c9972fe02c5e4137e8742aaaf5679ccea5a09
Reviewed-on: http://codereview.qt-project.org/5366
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 56c5c4836f..bf882bdf84 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1122,7 +1122,17 @@ QXcbEGLSurface *QXcbWindow::eglSurface() const void QXcbWindow::handleExposeEvent(const xcb_expose_event_t *event) { QRect rect(event->x, event->y, event->width, event->height); - QWindowSystemInterface::handleSynchronousExposeEvent(window(), rect); + + if (m_exposeRegion.isEmpty()) + m_exposeRegion = rect; + else + m_exposeRegion |= rect; + + // if count is non-zero there are more expose events pending + if (event->count == 0) { + QWindowSystemInterface::handleSynchronousExposeEvent(window(), m_exposeRegion); + m_exposeRegion = QRegion(); + } } void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *event) diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index e864c14f0f..e70686cba0 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -156,6 +156,8 @@ private: #if defined(XCB_USE_EGL) mutable QXcbEGLSurface *m_eglSurface; #endif + + QRegion m_exposeRegion; }; #endif |