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

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