diff options
-rw-r--r-- | src/client/qwaylandshmbackingstore.cpp | 11 | ||||
-rw-r--r-- | src/client/qwaylandshmbackingstore_p.h | 1 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 421fae91..332ea926 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -140,6 +140,9 @@ QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window) QWaylandShmBackingStore::~QWaylandShmBackingStore() { + if (QWaylandWindow *w = waylandWindow()) + w->setBackingStore(Q_NULLPTR); + if (mFrameCallback) wl_callback_destroy(mFrameCallback); @@ -175,6 +178,14 @@ void QWaylandShmBackingStore::endPaint() waylandWindow()->setCanResize(true); } +void QWaylandShmBackingStore::hidden() +{ + if (mFrameCallback) { + wl_callback_destroy(mFrameCallback); + mFrameCallback = Q_NULLPTR; + } +} + void QWaylandShmBackingStore::ensureSize() { waylandWindow()->setBackingStore(this); diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 5c3dbb5b..319acd9a 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -82,6 +82,7 @@ public: void resize(const QSize &size); void beginPaint(const QRegion &); void endPaint(); + void hidden(); QWaylandAbstractDecoration *windowDecoration() const; diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 5786c1fb..d1ea6c1f 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -54,6 +54,7 @@ #include "qwaylandwindowmanagerintegration_p.h" #include "qwaylandnativeinterface_p.h" #include "qwaylanddecorationfactory_p.h" +#include "qwaylandshmbackingstore_p.h" #include <QtCore/QFileInfo> #include <QtCore/QPointer> @@ -90,6 +91,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window) , mMouseDevice(0) , mMouseSerial(0) , mState(Qt::WindowNoState) + , mBackingStore(Q_NULLPTR) { init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this))); @@ -248,6 +250,9 @@ void QWaylandWindow::setVisible(bool visible) if (!deleteGuard.isNull()) { attach(static_cast<QWaylandBuffer *>(0), 0, 0); commit(); + if (mBackingStore) { + mBackingStore->hidden(); + } } } } |