diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-03-14 15:55:19 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-03-14 15:55:19 (GMT) |
commit | 369ad09515fc8dac87613930114f4b3cf6381e81 (patch) | |
tree | 9c623f2c9a7e4863f0a18cb0b53114644cfff24b /src/plugins/platforms/wayland/qwaylanddisplay.cpp | |
parent | 48ebe36a8b5d101c5dcad26d88d6fc0504fc9319 (diff) | |
download | Qt-369ad09515fc8dac87613930114f4b3cf6381e81.zip Qt-369ad09515fc8dac87613930114f4b3cf6381e81.tar.gz Qt-369ad09515fc8dac87613930114f4b3cf6381e81.tar.bz2 |
Fix race condition in the non-GL case
Make sure to also flush output when waiting for an ack from the
compositor, in case we haven't sent the frame request yet.
Reviewed-by: Jørgen
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylanddisplay.cpp')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylanddisplay.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index d0a0725..27f4334 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -141,7 +141,12 @@ void QWaylandDisplay::displayHandleGlobal(struct wl_display *display, } } -void QWaylandDisplay::eventDispatcher(void) +void QWaylandDisplay::iterate() +{ + wl_display_iterate(mDisplay, WL_DISPLAY_READABLE | WL_DISPLAY_WRITABLE); +} + +void QWaylandDisplay::readEvents(void) { wl_display_iterate(mDisplay, WL_DISPLAY_READABLE); } @@ -189,7 +194,7 @@ QWaylandDisplay::QWaylandDisplay(void) mNativeEglDisplay = 0; #endif - eventDispatcher(); + readEvents(); #ifdef QT_WAYLAND_GL_SUPPORT mEglDisplay = eglGetDisplay((EGLNativeDisplayType)mNativeEglDisplay); @@ -208,7 +213,7 @@ QWaylandDisplay::QWaylandDisplay(void) int fd = wl_display_get_fd(mDisplay, sourceUpdate, this); mReadNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this); connect(mReadNotifier, - SIGNAL(activated(int)), this, SLOT(eventDispatcher())); + SIGNAL(activated(int)), this, SLOT(readEvents())); mWriteNotifier = new QSocketNotifier(fd, QSocketNotifier::Write, this); connect(mWriteNotifier, |