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>
This commit is contained in:
Samuel Rødal 2011-09-22 09:02:40 +02:00 committed by Qt by Nokia
parent 078d701819
commit 5fb67c1dac
2 changed files with 13 additions and 1 deletions

View File

@ -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)

View File

@ -156,6 +156,8 @@ private:
#if defined(XCB_USE_EGL)
mutable QXcbEGLSurface *m_eglSurface;
#endif
QRegion m_exposeRegion;
};
#endif