Don't wipe window mask on every geometry change when compositing is active and no mask has been set.

Avoids an extra full repaint.
This commit is contained in:
Eike Hein 2016-03-01 17:26:17 +09:00
parent 60af310cfc
commit 3358c9eb9a

View File

@ -62,6 +62,7 @@ public:
: q(dialog), : q(dialog),
location(Plasma::Types::BottomEdge), location(Plasma::Types::BottomEdge),
frameSvgItem(0), frameSvgItem(0),
hasMask(false),
type(Dialog::Normal), type(Dialog::Normal),
hideOnWindowDeactivate(false), hideOnWindowDeactivate(false),
outputOnly(false), outputOnly(false),
@ -131,6 +132,7 @@ public:
QTimer hintsCommitTimer; QTimer hintsCommitTimer;
QRect cachedGeometry; QRect cachedGeometry;
bool hasMask;
Dialog::WindowType type; Dialog::WindowType type;
bool hideOnWindowDeactivate; bool hideOnWindowDeactivate;
bool outputOnly; bool outputOnly;
@ -228,9 +230,11 @@ void DialogPrivate::updateTheme()
theme.backgroundSaturation(), theme.backgroundSaturation(),
frameSvgItem->frameSvg()->mask()); frameSvgItem->frameSvg()->mask());
if (KWindowSystem::compositingActive()) { if (KWindowSystem::compositingActive() && hasMask) {
hasMask = false;
q->setMask(QRegion()); q->setMask(QRegion());
} else { } else {
hasMask = true;
q->setMask(frameSvgItem->frameSvg()->mask()); q->setMask(frameSvgItem->frameSvg()->mask());
} }
if (q->isVisible()) { if (q->isVisible()) {