diff options
author | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2023-03-18 22:20:36 +0200 |
---|---|---|
committer | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2023-03-20 09:59:57 +0200 |
commit | 504b9f1491d7244d05bee243bacf03aa9df1a17c (patch) | |
tree | 64992e936472d9ea9d19f3be4b264cb06c602917 | |
parent | 6fc74adfb97f55e241b841db39bbe6b8c81799b3 (diff) | |
download | qtwayland-504b9f1491d7244d05bee243bacf03aa9df1a17c.tar.gz |
Client: Fix wl_surface destruction order
The main thread can attempt to close the window while the QtQuick render
thread is still busy.
If that happens, ensure that QtQuick render thread has finished
rendering and presented the last frame before destroying the wp_viewport
and any other associated surface extensions so the window destruction
looks more reasonable.
Pick-to: 6.5
Change-Id: I8d2a3372fe6de51f357eed513baaa34a148470e3
Reviewed-by: David Edmundson <davidedmundson@kde.org>
-rw-r--r-- | src/client/qwaylandwindow.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 90f4c609..1111582e 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -267,18 +267,18 @@ void QWaylandWindow::endFrame() void QWaylandWindow::reset() { closeChildPopups(); - delete mShellSurface; - mShellSurface = nullptr; - delete mSubSurfaceWindow; - mSubSurfaceWindow = nullptr; - mViewport.reset(); - mFractionalScale.reset(); if (mSurface) { emit wlSurfaceDestroyed(); QWriteLocker lock(&mSurfaceLock); invalidateSurface(); + delete mShellSurface; + mShellSurface = nullptr; + delete mSubSurfaceWindow; + mSubSurfaceWindow = nullptr; mSurface.reset(); + mViewport.reset(); + mFractionalScale.reset(); } { |