summaryrefslogtreecommitdiff
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r--src/client/qwaylandwindow.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 3481a8fa..0b4347a8 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -77,6 +77,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window, QWaylandDisplay *display)
: QPlatformWindow(window)
, mDisplay(display)
, mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
+ , mSurfaceLock(QReadWriteLock::Recursive)
{
{
bool ok;
@@ -235,6 +236,16 @@ bool QWaylandWindow::shouldCreateSubSurface() const
return QPlatformWindow::parent() != nullptr;
}
+void QWaylandWindow::beginFrame()
+{
+ mSurfaceLock.lockForRead();
+}
+
+void QWaylandWindow::endFrame()
+{
+ mSurfaceLock.unlock();
+}
+
void QWaylandWindow::reset()
{
delete mShellSurface;
@@ -242,10 +253,10 @@ void QWaylandWindow::reset()
delete mSubSurfaceWindow;
mSubSurfaceWindow = nullptr;
- invalidateSurface();
if (mSurface) {
emit wlSurfaceDestroyed();
QWriteLocker lock(&mSurfaceLock);
+ invalidateSurface();
mSurface.reset();
}