diff options
author | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2023-03-18 22:20:36 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-20 08:43:50 +0000 |
commit | 325a2338976c3cca6278436af03e7bd4e4378d7c (patch) | |
tree | e78094e7cc6fcc058cd1be65e3579b02c69785b4 /src | |
parent | 4e37b2e579e3bb9273aaddc1c2f29e88fce8b2c7 (diff) | |
download | qtwayland-325a2338976c3cca6278436af03e7bd4e4378d7c.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.
Change-Id: I8d2a3372fe6de51f357eed513baaa34a148470e3
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 504b9f1491d7244d05bee243bacf03aa9df1a17c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-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 a1c3a58e..d2199df4 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -262,18 +262,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(); } { |