diff options
author | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2024-01-19 13:43:08 +0200 |
---|---|---|
committer | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2024-02-20 20:24:21 +0200 |
commit | 9db8724e1111ad2d7cd10f4a6df42cfb395a37be (patch) | |
tree | 717ef92930006bc5424e283d06d945098cbadfd8 /src/client | |
parent | 9bad0fc2fd89fc5a7e77bef95e830a6dee1be731 (diff) |
Client: Emit wlSurfaceDestroyed after actually destroying wl_surface
At the moment, the QWaylandWindow::wlSurfaceDestroyed signal is emitted
before destroying the wl_surface object. It's the opposite of its name.
Furthermore, the client code in Plasma assumes that the
wlSurfaceDestroyed signal is emitted after the wl_surface is gone, but
it isn't, which is the source of bugs.
Technically, it's an API breaking change. But this ordering issue is
quite annoying to deal in the client code and the QWaylandWindow native
interface api lives in the Private namespace.
[ChangeLog][QtWaylandClient][Important Behavior Changes] The
QWaylandWindow::surfaceDestroyed() signal is emitted after actually
destroying the wl_surface object.
Change-Id: I33e27c06795653d3e20e04a36cb39be8c46797ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index bb33a747f..4c8d2eedc 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -283,19 +283,21 @@ void QWaylandWindow::reset() mTopPopup = mTransientParent && (mTransientParent->window()->type() == Qt::Popup) ? mTransientParent : nullptr; if (mSurface) { + { + QWriteLocker lock(&mSurfaceLock); + invalidateSurface(); + if (mTransientParent) + mTransientParent->removeChildPopup(this); + delete mShellSurface; + mShellSurface = nullptr; + delete mSubSurfaceWindow; + mSubSurfaceWindow = nullptr; + mTransientParent = nullptr; + mSurface.reset(); + mViewport.reset(); + mFractionalScale.reset(); + } emit wlSurfaceDestroyed(); - QWriteLocker lock(&mSurfaceLock); - invalidateSurface(); - if (mTransientParent) - mTransientParent->removeChildPopup(this); - delete mShellSurface; - mShellSurface = nullptr; - delete mSubSurfaceWindow; - mSubSurfaceWindow = nullptr; - mTransientParent = nullptr; - mSurface.reset(); - mViewport.reset(); - mFractionalScale.reset(); } { |