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 13:54:15 +0000
commite09e4bad6eea7fa91ed8e0271b4bca3d94541a28 (patch)
tree4dd072c88c8552038a929f58eb7826b887908ea8
parentd3eddf1e19a3d1a0ff76298d2c66d1a694926d99 (diff)
downloadqtwayland-e09e4bad6eea7fa91ed8e0271b4bca3d94541a28.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 557d58c9..2a0fdaf6 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -478,15 +478,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);