[KScreen Effect] Fix fade to black
Summary: When you have two windows ontop of each other and you turn them transparent, evidently you'll be able to see through them. Not only does it look unpolished if the desktop window flashes through your windows, it can pose a privacy risk as you'd be able to briefly look through the lock screen. This patch fades apps to black intead of to transparent. As this looks weird for panels, so windows are also faded to opaque (if relevant) at the same rate. BUG: 388384 Reviewers: #plasma, graesslin Subscribers: luebking, plasma-devel, kwin, #kwin Tags: #plasma Differential Revision: https://phabricator.kde.org/D9608icc-effect-5.14.5
parent
ed4a936315
commit
437a36a2bb
|
@ -105,15 +105,19 @@ void KscreenEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data, in
|
|||
|
||||
void KscreenEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
|
||||
{
|
||||
//fade to black and fully opaque
|
||||
switch (m_state) {
|
||||
case StateFadingOut:
|
||||
data.multiplyOpacity(1.0 - m_timeLine.currentValue());
|
||||
data.setOpacity(data.opacity() + (1.0 - data.opacity()) * m_timeLine.currentValue());
|
||||
data.multiplyBrightness(1.0 - m_timeLine.currentValue());
|
||||
break;
|
||||
case StateFadedOut:
|
||||
data.multiplyOpacity(0.0);
|
||||
data.multiplyBrightness(0.0);
|
||||
break;
|
||||
case StateFadingIn:
|
||||
data.multiplyOpacity(m_timeLine.currentValue());
|
||||
data.setOpacity(data.opacity() + (1.0 - data.opacity()) * (1.0 - m_timeLine.currentValue()));
|
||||
data.multiplyBrightness(m_timeLine.currentValue());
|
||||
break;
|
||||
default:
|
||||
// no adjustment
|
||||
|
|
Loading…
Reference in New Issue