diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-10 14:00:08 +0300 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-05-10 19:14:55 +0200 |
commit | 9bf1e7ddce29dd2d84d514b37c87fe7f9adc5b63 (patch) | |
tree | fd3cc93527ac2c3bafcb5df025b5e656c16889b6 /src | |
parent | bce79256f32e1e14858d4a63d17e000fd78a8a0f (diff) |
Do not crash all the time with shm apps
Change-Id: Iea42adf18cbd724f1f9dc19ec1d1f6baeff07d97
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandwindow.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index 5858f2478..d21a9950a 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -265,10 +265,11 @@ QImage *QWaylandShmBackingStore::entireSurface() const void QWaylandShmBackingStore::done(void *data, wl_callback *callback, uint32_t time) { - Q_UNUSED(callback); Q_UNUSED(time); QWaylandShmBackingStore *self = static_cast<QWaylandShmBackingStore *>(data); + if (callback != self->mFrameCallback) // others, like QWaylandWindow, may trigger callbacks too + return; QWaylandWindow *window = self->waylandWindow(); wl_callback_destroy(self->mFrameCallback); self->mFrameCallback = 0; diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index c023de58e..5635322f0 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -228,11 +228,12 @@ const wl_callback_listener QWaylandWindow::callbackListener = { QWaylandWindow::frameCallback }; -void QWaylandWindow::frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time) +void QWaylandWindow::frameCallback(void *data, struct wl_callback *callback, uint32_t time) { Q_UNUSED(time); - Q_UNUSED(wl_callback); QWaylandWindow *self = static_cast<QWaylandWindow*>(data); + if (callback != self->mFrameCallback) // might be a callback caused by the shm backingstore + return; self->mWaitingForFrameSync = false; if (self->mFrameCallback) { wl_callback_destroy(self->mFrameCallback); |