plasma: do not guess the mask color in FrameSvg::mask()

using the mask created by QPixmap::mask() is much more reliable way
to get one, fixes masking in case compositor is not active for example

side note: feels good to finally land the fix for masking

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-06 09:19:46 +02:00
parent a3d14ed9f8
commit aef479ab03

View file

@ -454,7 +454,7 @@ QRegion FrameSvg::mask() const
if (frame->cachedMasks.count() > frame->MAX_CACHED_MASKS) {
frame->cachedMasks.clear();
}
frame->cachedMasks.insert(id, QRegion(QBitmap(d->alphaMask().alphaChannel().createMaskFromColor(Qt::black))));
frame->cachedMasks.insert(id, QRegion(d->alphaMask().mask()));
}
return frame->cachedMasks[id];
}