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
Pick-to: 5.15 6.2
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Aleix Pol 2021-07-13 13:32:15 +02:00
parent 80c336554d
commit c4b1dbfc06

View File

@ -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);