summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/qwaylandshmbackingstore.cpp3
-rw-r--r--src/client/qwaylandshmbackingstore_p.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index d407335d3..6ca65f053 100644
--- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/qwaylandshmbackingstore.cpp
@@ -46,6 +46,7 @@
#include <QtCore/qdebug.h>
#include <QtGui/QPainter>
+#include <QMutexLocker>
#include <wayland-client.h>
#include <unistd.h>
@@ -180,6 +181,7 @@ void QWaylandShmBackingStore::endPaint()
void QWaylandShmBackingStore::hidden()
{
+ QMutexLocker lock(&mMutex);
if (mFrameCallback) {
wl_callback_destroy(mFrameCallback);
mFrameCallback = Q_NULLPTR;
@@ -341,6 +343,7 @@ void QWaylandShmBackingStore::done(void *data, wl_callback *callback, uint32_t t
static_cast<QWaylandShmBackingStore *>(data);
if (callback != self->mFrameCallback) // others, like QWaylandWindow, may trigger callbacks too
return;
+ QMutexLocker lock(&self->mMutex);
QWaylandWindow *window = self->waylandWindow();
wl_callback_destroy(self->mFrameCallback);
self->mFrameCallback = 0;
diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h
index 1212e52fe..c0d730dee 100644
--- a/src/client/qwaylandshmbackingstore_p.h
+++ b/src/client/qwaylandshmbackingstore_p.h
@@ -47,6 +47,7 @@
#include <qpa/qplatformbackingstore.h>
#include <QtGui/QImage>
#include <qpa/qplatformwindow.h>
+#include <QMutex>
QT_BEGIN_NAMESPACE
@@ -106,6 +107,7 @@ private:
QWaylandShmBuffer *mBackBuffer;
bool mFrontBufferIsDirty;
bool mPainting;
+ QMutex mMutex;
QSize mRequestedSize;
Qt::WindowFlags mCurrentWindowFlags;