Blame SOURCES/0029-Do-not-update-the-mask-if-we-do-not-have-a-surface.patch

f8c1a9
From d4c41797b61a5a8da47c5821711aca72e756dcbf Mon Sep 17 00:00:00 2001
f8c1a9
From: Aleix Pol <aleixpol@kde.org>
f8c1a9
Date: Tue, 13 Jul 2021 13:32:15 +0200
f8c1a9
Subject: [PATCH 29/36] Do not update the mask if we do not have a surface
f8c1a9
f8c1a9
mMask serves as a cache to remember what we've sent, the source of truth
f8c1a9
for the value is window()->mask().
f8c1a9
No need to store values that we are going to discard, because it will
f8c1a9
confuse the state of newly created windows.
f8c1a9
f8c1a9
Change-Id: I6aa3da82c7f09c7ef90d0f7060f292fb042730f0
f8c1a9
Pick-to: 5.15 6.2
f8c1a9
Reviewed-by: David Edmundson <davidedmundson@kde.org>
f8c1a9
(cherry picked from commit 962f87190c682562b369c5ebd93dc9ce0915ed7a)
f8c1a9
---
f8c1a9
 src/client/qwaylandwindow.cpp | 7 ++++---
f8c1a9
 1 file changed, 4 insertions(+), 3 deletions(-)
f8c1a9
f8c1a9
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
f8c1a9
index e96d8fe9..bd70f4af 100644
f8c1a9
--- a/src/client/qwaylandwindow.cpp
f8c1a9
+++ b/src/client/qwaylandwindow.cpp
f8c1a9
@@ -464,14 +464,15 @@ void QWaylandWindow::lower()
f8c1a9
 
f8c1a9
 void QWaylandWindow::setMask(const QRegion &mask)
f8c1a9
 {
f8c1a9
+    QReadLocker locker(&mSurfaceLock);
f8c1a9
+    if (!mSurface)
f8c1a9
+        return;
f8c1a9
+
f8c1a9
     if (mMask == mask)
f8c1a9
         return;
f8c1a9
 
f8c1a9
     mMask = mask;
f8c1a9
 
f8c1a9
-    if (!mSurface)
f8c1a9
-        return;
f8c1a9
-
f8c1a9
     if (mMask.isEmpty()) {
f8c1a9
         mSurface->set_input_region(nullptr);
f8c1a9
 
f8c1a9
-- 
f8c1a9
2.33.1
f8c1a9