summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2021-07-13 13:32:15 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-13 14:24:15 +0000
commitb602ea40351d3d5defb1d08bc36254aae84b47da (patch)
tree018cfe2a63b53c1fdb8b531c75af67ee96ac23a4
parent8abaf1e6bcb0b2dd419fb8527ff18fb23e4a3d19 (diff)
downloadqtwayland-b602ea40351d3d5defb1d08bc36254aae84b47da.tar.gz
Do not update the mask if we do not have a surface
mMask serves as a cache to remember what we've sent, the source of truth for the value is window()->mask(). No need to store values that we are going to discard, because it will confuse the state of newly created windows. Change-Id: I6aa3da82c7f09c7ef90d0f7060f292fb042730f0 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 962f87190c682562b369c5ebd93dc9ce0915ed7a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandwindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 06303de3..746cc4cf 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -465,15 +465,15 @@ void QWaylandWindow::lower()
void QWaylandWindow::setMask(const QRegion &mask)
{
+ QReadLocker locker(&mSurfaceLock);
+ if (!mSurface)
+ return;
+
if (mMask == mask)
return;
mMask = mask;
- QReadLocker locker(&mSurfaceLock);
- if (!mSurface)
- return;
-
if (mMask.isEmpty()) {
mSurface->set_input_region(nullptr);