2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2007 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2007 Christian Nitschkowski <christian.nitschkowski@kdemail.net>
|
|
|
|
SPDX-FileCopyrightText: 2018 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
2020-08-02 22:10:35 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
// own
|
2007-04-29 17:35:43 +00:00
|
|
|
#include "diminactive.h"
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
2012-09-11 22:42:46 +00:00
|
|
|
// KConfigSkeleton
|
|
|
|
#include "diminactiveconfig.h"
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
/**
|
|
|
|
* Checks if two windows belong to the same window group
|
|
|
|
*
|
|
|
|
* One possible example of a window group is an app window and app
|
|
|
|
* preferences window(e.g. Dolphin window and Dolphin Preferences window).
|
|
|
|
*
|
|
|
|
* @param w1 The first window
|
|
|
|
* @param w2 The second window
|
|
|
|
* @returns @c true if both windows belong to the same window group, @c false otherwise
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
static inline bool belongToSameGroup(const EffectWindow *w1, const EffectWindow *w2)
|
|
|
|
{
|
|
|
|
return w1 && w2 && w1->group() && w1->group() == w2->group();
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
DimInactiveEffect::DimInactiveEffect()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2016-12-02 19:27:43 +00:00
|
|
|
initConfig<DimInactiveConfig>();
|
2011-01-30 14:34:42 +00:00
|
|
|
reconfigure(ReconfigureAll);
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
|
|
|
connect(effects, &EffectsHandler::windowActivated,
|
|
|
|
this, &DimInactiveEffect::windowActivated);
|
|
|
|
connect(effects, &EffectsHandler::windowClosed,
|
|
|
|
this, &DimInactiveEffect::windowClosed);
|
|
|
|
connect(effects, &EffectsHandler::windowDeleted,
|
|
|
|
this, &DimInactiveEffect::windowDeleted);
|
|
|
|
connect(effects, &EffectsHandler::activeFullScreenEffectChanged,
|
|
|
|
this, &DimInactiveEffect::activeFullScreenEffectChanged);
|
2018-10-17 11:05:11 +00:00
|
|
|
connect(effects, &EffectsHandler::windowKeepAboveChanged,
|
|
|
|
this, &DimInactiveEffect::updateActiveWindow);
|
|
|
|
connect(effects, &EffectsHandler::windowFullScreenChanged,
|
|
|
|
this, &DimInactiveEffect::updateActiveWindow);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-13 16:20:52 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
DimInactiveEffect::~DimInactiveEffect()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::reconfigure(ReconfigureFlags flags)
|
|
|
|
{
|
|
|
|
Q_UNUSED(flags)
|
|
|
|
|
2014-03-25 15:29:03 +00:00
|
|
|
DimInactiveConfig::self()->read();
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
|
|
|
// TODO: Use normalized strength param.
|
|
|
|
m_dimStrength = DimInactiveConfig::strength() / 100.0;
|
|
|
|
m_dimPanels = DimInactiveConfig::dimPanels();
|
|
|
|
m_dimDesktop = DimInactiveConfig::dimDesktop();
|
|
|
|
m_dimKeepAbove = DimInactiveConfig::dimKeepAbove();
|
|
|
|
m_dimByGroup = DimInactiveConfig::dimByGroup();
|
2018-10-15 07:09:27 +00:00
|
|
|
m_dimFullScreen = DimInactiveConfig::dimFullScreen();
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
2018-10-17 11:05:11 +00:00
|
|
|
updateActiveWindow(effects->activeWindow());
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
|
|
|
m_activeWindowGroup = (m_dimByGroup && m_activeWindow)
|
|
|
|
? m_activeWindow->group()
|
|
|
|
: nullptr;
|
|
|
|
|
|
|
|
m_fullScreenTransition.timeLine.setDuration(
|
|
|
|
std::chrono::milliseconds(static_cast<int>(animationTime(250))));
|
|
|
|
|
2012-10-12 19:01:54 +00:00
|
|
|
effects->addRepaintFull();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
Provide expected presentation time to effects
Effects are given the interval between two consecutive frames. The main
flaw of this approach is that if the Compositor transitions from the idle
state to "active" state, i.e. when there is something to repaint,
effects may see a very large interval between the last painted frame and
the current. In order to address this issue, the Scene invalidates the
timer that is used to measure time between consecutive frames before the
Compositor is about to become idle.
While this works perfectly fine with Xinerama-style rendering, with per
screen rendering, determining whether the compositor is about to idle is
rather a tedious task mostly because a single output can't be used for
the test.
Furthermore, since the Compositor schedules pointless repaints just to
ensure that it's idle, it might take several attempts to figure out
whether the scene timer must be invalidated if you use (true) per screen
rendering.
Ideally, all effects should use a timeline helper that is aware of the
underlying render loop and its timings. However, this option is off the
table because it will involve a lot of work to implement it.
Alternative and much simpler option is to pass the expected presentation
time to effects rather than time between consecutive frames. This means
that effects are responsible for determining how much animation timelines
have to be advanced. Typically, an effect would have to store the
presentation timestamp provided in either prePaint{Screen,Window} and
use it in the subsequent prePaint{Screen,Window} call to estimate the
amount of time passed between the next and the last frames.
Unfortunately, this is an API incompatible change. However, it shouldn't
take a lot of work to port third-party binary effects, which don't use the
AnimationEffect class, to the new API. On the bright side, we no longer
need to be concerned about the Compositor getting idle.
We do still try to determine whether the Compositor is about to idle,
primarily, because the OpenGL render backend swaps buffers on present,
but that will change with the ongoing compositing timing rework.
2020-11-20 15:44:04 +00:00
|
|
|
void DimInactiveEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
Provide expected presentation time to effects
Effects are given the interval between two consecutive frames. The main
flaw of this approach is that if the Compositor transitions from the idle
state to "active" state, i.e. when there is something to repaint,
effects may see a very large interval between the last painted frame and
the current. In order to address this issue, the Scene invalidates the
timer that is used to measure time between consecutive frames before the
Compositor is about to become idle.
While this works perfectly fine with Xinerama-style rendering, with per
screen rendering, determining whether the compositor is about to idle is
rather a tedious task mostly because a single output can't be used for
the test.
Furthermore, since the Compositor schedules pointless repaints just to
ensure that it's idle, it might take several attempts to figure out
whether the scene timer must be invalidated if you use (true) per screen
rendering.
Ideally, all effects should use a timeline helper that is aware of the
underlying render loop and its timings. However, this option is off the
table because it will involve a lot of work to implement it.
Alternative and much simpler option is to pass the expected presentation
time to effects rather than time between consecutive frames. This means
that effects are responsible for determining how much animation timelines
have to be advanced. Typically, an effect would have to store the
presentation timestamp provided in either prePaint{Screen,Window} and
use it in the subsequent prePaint{Screen,Window} call to estimate the
amount of time passed between the next and the last frames.
Unfortunately, this is an API incompatible change. However, it shouldn't
take a lot of work to port third-party binary effects, which don't use the
AnimationEffect class, to the new API. On the bright side, we no longer
need to be concerned about the Compositor getting idle.
We do still try to determine whether the Compositor is about to idle,
primarily, because the OpenGL render backend swaps buffers on present,
but that will change with the ongoing compositing timing rework.
2020-11-20 15:44:04 +00:00
|
|
|
std::chrono::milliseconds delta(0);
|
|
|
|
if (m_lastPresentTime.count()) {
|
|
|
|
delta = presentTime - m_lastPresentTime;
|
|
|
|
}
|
|
|
|
m_lastPresentTime = presentTime;
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
|
|
|
if (m_fullScreenTransition.active) {
|
|
|
|
m_fullScreenTransition.timeLine.update(delta);
|
2009-02-07 09:48:20 +00:00
|
|
|
}
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
|
|
|
auto transitionIt = m_transitions.begin();
|
|
|
|
while (transitionIt != m_transitions.end()) {
|
|
|
|
(*transitionIt).update(delta);
|
|
|
|
++transitionIt;
|
|
|
|
}
|
|
|
|
|
Provide expected presentation time to effects
Effects are given the interval between two consecutive frames. The main
flaw of this approach is that if the Compositor transitions from the idle
state to "active" state, i.e. when there is something to repaint,
effects may see a very large interval between the last painted frame and
the current. In order to address this issue, the Scene invalidates the
timer that is used to measure time between consecutive frames before the
Compositor is about to become idle.
While this works perfectly fine with Xinerama-style rendering, with per
screen rendering, determining whether the compositor is about to idle is
rather a tedious task mostly because a single output can't be used for
the test.
Furthermore, since the Compositor schedules pointless repaints just to
ensure that it's idle, it might take several attempts to figure out
whether the scene timer must be invalidated if you use (true) per screen
rendering.
Ideally, all effects should use a timeline helper that is aware of the
underlying render loop and its timings. However, this option is off the
table because it will involve a lot of work to implement it.
Alternative and much simpler option is to pass the expected presentation
time to effects rather than time between consecutive frames. This means
that effects are responsible for determining how much animation timelines
have to be advanced. Typically, an effect would have to store the
presentation timestamp provided in either prePaint{Screen,Window} and
use it in the subsequent prePaint{Screen,Window} call to estimate the
amount of time passed between the next and the last frames.
Unfortunately, this is an API incompatible change. However, it shouldn't
take a lot of work to port third-party binary effects, which don't use the
AnimationEffect class, to the new API. On the bright side, we no longer
need to be concerned about the Compositor getting idle.
We do still try to determine whether the Compositor is about to idle,
primarily, because the OpenGL render backend swaps buffers on present,
but that will change with the ongoing compositing timing rework.
2020-11-20 15:44:04 +00:00
|
|
|
effects->prePaintScreen(data, presentTime);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2009-02-07 09:48:20 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
void DimInactiveEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
auto transitionIt = m_transitions.constFind(w);
|
|
|
|
if (transitionIt != m_transitions.constEnd()) {
|
|
|
|
const qreal transitionProgress = (*transitionIt).value();
|
|
|
|
dimWindow(data, m_dimStrength * transitionProgress);
|
|
|
|
effects->paintWindow(w, mask, region, data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto forceIt = m_forceDim.constFind(w);
|
|
|
|
if (forceIt != m_forceDim.constEnd()) {
|
|
|
|
const qreal forcedStrength = *forceIt;
|
|
|
|
dimWindow(data, forcedStrength);
|
|
|
|
effects->paintWindow(w, mask, region, data);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (canDimWindow(w)) {
|
|
|
|
dimWindow(data, m_dimStrength);
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
effects->paintWindow(w, mask, region, data);
|
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
void DimInactiveEffect::postPaintScreen()
|
|
|
|
{
|
|
|
|
if (m_fullScreenTransition.active) {
|
|
|
|
if (m_fullScreenTransition.timeLine.done()) {
|
|
|
|
m_fullScreenTransition.active = false;
|
|
|
|
}
|
|
|
|
effects->addRepaintFull();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto transitionIt = m_transitions.begin();
|
|
|
|
while (transitionIt != m_transitions.end()) {
|
|
|
|
EffectWindow *w = transitionIt.key();
|
|
|
|
if ((*transitionIt).done()) {
|
|
|
|
transitionIt = m_transitions.erase(transitionIt);
|
|
|
|
} else {
|
|
|
|
++transitionIt;
|
|
|
|
}
|
|
|
|
w->addRepaintFull();
|
|
|
|
}
|
|
|
|
|
Provide expected presentation time to effects
Effects are given the interval between two consecutive frames. The main
flaw of this approach is that if the Compositor transitions from the idle
state to "active" state, i.e. when there is something to repaint,
effects may see a very large interval between the last painted frame and
the current. In order to address this issue, the Scene invalidates the
timer that is used to measure time between consecutive frames before the
Compositor is about to become idle.
While this works perfectly fine with Xinerama-style rendering, with per
screen rendering, determining whether the compositor is about to idle is
rather a tedious task mostly because a single output can't be used for
the test.
Furthermore, since the Compositor schedules pointless repaints just to
ensure that it's idle, it might take several attempts to figure out
whether the scene timer must be invalidated if you use (true) per screen
rendering.
Ideally, all effects should use a timeline helper that is aware of the
underlying render loop and its timings. However, this option is off the
table because it will involve a lot of work to implement it.
Alternative and much simpler option is to pass the expected presentation
time to effects rather than time between consecutive frames. This means
that effects are responsible for determining how much animation timelines
have to be advanced. Typically, an effect would have to store the
presentation timestamp provided in either prePaint{Screen,Window} and
use it in the subsequent prePaint{Screen,Window} call to estimate the
amount of time passed between the next and the last frames.
Unfortunately, this is an API incompatible change. However, it shouldn't
take a lot of work to port third-party binary effects, which don't use the
AnimationEffect class, to the new API. On the bright side, we no longer
need to be concerned about the Compositor getting idle.
We do still try to determine whether the Compositor is about to idle,
primarily, because the OpenGL render backend swaps buffers on present,
but that will change with the ongoing compositing timing rework.
2020-11-20 15:44:04 +00:00
|
|
|
if (m_transitions.isEmpty() && !m_fullScreenTransition.active) {
|
|
|
|
m_lastPresentTime = std::chrono::milliseconds::zero();
|
|
|
|
}
|
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
effects->postPaintScreen();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::dimWindow(WindowPaintData &data, qreal strength)
|
|
|
|
{
|
|
|
|
qreal dimFactor;
|
|
|
|
if (m_fullScreenTransition.active) {
|
|
|
|
dimFactor = 1.0 - m_fullScreenTransition.timeLine.value();
|
|
|
|
} else if (effects->activeFullScreenEffect()) {
|
|
|
|
dimFactor = 0.0;
|
|
|
|
} else {
|
|
|
|
dimFactor = 1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
data.multiplyBrightness(1.0 - strength * dimFactor);
|
|
|
|
data.multiplySaturation(1.0 - strength * dimFactor);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DimInactiveEffect::canDimWindow(const EffectWindow *w) const
|
|
|
|
{
|
|
|
|
if (m_activeWindow == w) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_dimByGroup && belongToSameGroup(m_activeWindow, w)) {
|
2008-01-02 15:17:58 +00:00
|
|
|
return false;
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (w->isDock() && !m_dimPanels) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (w->isDesktop() && !m_dimDesktop) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (w->keepAbove() && !m_dimKeepAbove) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-10-15 07:09:27 +00:00
|
|
|
if (w->isFullScreen() && !m_dimFullScreen) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-10-19 09:38:27 +00:00
|
|
|
if (w->isPopupWindow()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (w->isX11Client() && !w->isManaged()) {
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return w->isNormalWindow()
|
|
|
|
|| w->isDialog()
|
|
|
|
|| w->isUtility()
|
|
|
|
|| w->isDock()
|
|
|
|
|| w->isDesktop();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2008-01-02 15:17:58 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
void DimInactiveEffect::scheduleInTransition(EffectWindow *w)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
TimeLine &timeLine = m_transitions[w];
|
|
|
|
timeLine.setDuration(
|
|
|
|
std::chrono::milliseconds(static_cast<int>(animationTime(160))));
|
|
|
|
if (timeLine.done()) {
|
|
|
|
// If the Out animation is still active, then we're trucating
|
|
|
|
// duration of the timeline(from 250ms to 160ms). If the timeline
|
|
|
|
// is about to be finished with the old duration, then after
|
|
|
|
// changing duration it will be in the "done" state. Thus, we
|
|
|
|
// have to reset the timeline, otherwise it won't update progress.
|
|
|
|
timeLine.reset();
|
|
|
|
}
|
|
|
|
timeLine.setDirection(TimeLine::Backward);
|
|
|
|
timeLine.setEasingCurve(QEasingCurve::InOutSine);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2009-02-09 14:36:47 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
void DimInactiveEffect::scheduleGroupInTransition(EffectWindow *w)
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
if (!m_dimByGroup) {
|
|
|
|
scheduleInTransition(w);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!w->group()) {
|
|
|
|
scheduleInTransition(w);
|
|
|
|
return;
|
|
|
|
}
|
2009-02-07 09:48:20 +00:00
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
const auto members = w->group()->members();
|
|
|
|
for (EffectWindow *member : members) {
|
|
|
|
scheduleInTransition(member);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::scheduleOutTransition(EffectWindow *w)
|
|
|
|
{
|
|
|
|
TimeLine &timeLine = m_transitions[w];
|
|
|
|
timeLine.setDuration(
|
|
|
|
std::chrono::milliseconds(static_cast<int>(animationTime(250))));
|
|
|
|
if (timeLine.done()) {
|
|
|
|
timeLine.reset();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
timeLine.setDirection(TimeLine::Forward);
|
|
|
|
timeLine.setEasingCurve(QEasingCurve::InOutSine);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::scheduleGroupOutTransition(EffectWindow *w)
|
|
|
|
{
|
|
|
|
if (!m_dimByGroup) {
|
|
|
|
scheduleOutTransition(w);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!w->group()) {
|
|
|
|
scheduleOutTransition(w);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto members = w->group()->members();
|
|
|
|
for (EffectWindow *member : members) {
|
|
|
|
scheduleOutTransition(member);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::scheduleRepaint(EffectWindow *w)
|
|
|
|
{
|
|
|
|
if (!m_dimByGroup) {
|
|
|
|
w->addRepaintFull();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!w->group()) {
|
|
|
|
w->addRepaintFull();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto members = w->group()->members();
|
|
|
|
for (EffectWindow *member : members) {
|
|
|
|
member->addRepaintFull();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::windowActivated(EffectWindow *w)
|
|
|
|
{
|
|
|
|
if (!w) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_activeWindow == w) {
|
|
|
|
return;
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
|
|
|
|
if (m_dimByGroup && belongToSameGroup(m_activeWindow, w)) {
|
|
|
|
m_activeWindow = w;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// WORKAROUND: Deleted windows do not belong to any of window groups.
|
|
|
|
// So, if one of windows in a window group is closed, the In transition
|
|
|
|
// will be false-triggered for the rest of the window group. In addition
|
|
|
|
// to the active window, keep track of active window group so we can
|
|
|
|
// tell whether "focus" moved from a closed window to some other window
|
|
|
|
// in a window group.
|
|
|
|
if (m_dimByGroup && w->group() && w->group() == m_activeWindowGroup) {
|
|
|
|
m_activeWindow = w;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindow *previousActiveWindow = m_activeWindow;
|
|
|
|
m_activeWindow = canDimWindow(w) ? w : nullptr;
|
|
|
|
|
|
|
|
m_activeWindowGroup = (m_dimByGroup && m_activeWindow)
|
|
|
|
? m_activeWindow->group()
|
|
|
|
: nullptr;
|
|
|
|
|
|
|
|
if (previousActiveWindow) {
|
|
|
|
scheduleGroupOutTransition(previousActiveWindow);
|
|
|
|
scheduleRepaint(previousActiveWindow);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_activeWindow) {
|
|
|
|
scheduleGroupInTransition(m_activeWindow);
|
|
|
|
scheduleRepaint(m_activeWindow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::windowClosed(EffectWindow *w)
|
|
|
|
{
|
|
|
|
// When a window is closed, we should force current dim strength that
|
|
|
|
// is applied to it to avoid flickering when some effect animates
|
|
|
|
// the disappearing of the window. If there is no such effect then
|
|
|
|
// it won't be dimmed.
|
|
|
|
qreal forcedStrength = 0.0;
|
|
|
|
bool shouldForceDim = false;
|
|
|
|
|
|
|
|
auto transitionIt = m_transitions.find(w);
|
|
|
|
if (transitionIt != m_transitions.end()) {
|
|
|
|
forcedStrength = m_dimStrength * (*transitionIt).value();
|
|
|
|
shouldForceDim = true;
|
|
|
|
m_transitions.erase(transitionIt);
|
|
|
|
} else if (m_activeWindow == w) {
|
|
|
|
forcedStrength = 0.0;
|
|
|
|
shouldForceDim = true;
|
|
|
|
} else if (m_dimByGroup && belongToSameGroup(m_activeWindow, w)) {
|
|
|
|
forcedStrength = 0.0;
|
|
|
|
shouldForceDim = true;
|
|
|
|
} else if (canDimWindow(w)) {
|
|
|
|
forcedStrength = m_dimStrength;
|
|
|
|
shouldForceDim = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (shouldForceDim) {
|
|
|
|
m_forceDim.insert(w, forcedStrength);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_activeWindow == w) {
|
|
|
|
m_activeWindow = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::windowDeleted(EffectWindow *w)
|
|
|
|
{
|
|
|
|
m_forceDim.remove(w);
|
[effects/diminactive] Delete active transitions when window is deleted
Summary:
The Dim Inactive effect expects that the windowClosed signal always
proceeds the windowDeleted signal. But in some cases that's not the case.
If a window gets destroyed before becoming ready for painting, only
the windowDeleted signal will be emitted. In addition to that, KWin will
activate that window, which means we'll probably start a transition for
it.
Because this effect cannot terminate active transitions for such
windows, KWin can crash in postPaintScreen.
This change addresses the crash in postPaintScreen by adding extra clean
up stuff in the windowDeleted slot to make sure that there are no
transitions for deleted windows.
The proper fix would be to not emit windowActivated signal for windows
that are not ready for painting.
BUG: 399612
FIXED-IN: 5.14.1
Test Plan:
Ran
```
x <- seq(5, 15, length=1000)
y <- dnorm(x, mean=10, sd=3)
plot(x, y, type="l", lwd=1)
```
in RKWard multiple times.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16130
2018-10-11 14:02:35 +00:00
|
|
|
|
|
|
|
// FIXME: Sometimes we can miss the window close signal because KWin
|
|
|
|
// can activate a window that is not ready for painting and the window
|
|
|
|
// gets destroyed immediately. So, we have to remove active transitions
|
|
|
|
// for that window here, otherwise we'll crash in postPaintScreen.
|
|
|
|
m_transitions.remove(w);
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DimInactiveEffect::activeFullScreenEffectChanged()
|
|
|
|
{
|
|
|
|
if (m_fullScreenTransition.timeLine.done()) {
|
|
|
|
m_fullScreenTransition.timeLine.reset();
|
|
|
|
}
|
|
|
|
m_fullScreenTransition.timeLine.setDirection(
|
|
|
|
effects->activeFullScreenEffect()
|
|
|
|
? TimeLine::Forward
|
|
|
|
: TimeLine::Backward
|
|
|
|
);
|
|
|
|
m_fullScreenTransition.active = true;
|
|
|
|
|
|
|
|
effects->addRepaintFull();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2018-10-17 11:05:11 +00:00
|
|
|
void DimInactiveEffect::updateActiveWindow(EffectWindow *w)
|
|
|
|
{
|
|
|
|
if (effects->activeWindow() == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (effects->activeWindow() != w) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Need to reset m_activeWindow because canDimWindow depends on it.
|
|
|
|
m_activeWindow = nullptr;
|
|
|
|
|
|
|
|
m_activeWindow = canDimWindow(w) ? w : nullptr;
|
|
|
|
}
|
|
|
|
|
[effects] Rewrite the Dim Inactive effect
Summary:
The Dim Inactive effect was rewritten mostly to fix most of issues with
it, e.g. after leaving a full screen effect(e.g. Desktop Grid) windows
sometimes are not dimmed back, or when a window becomes inactive there
is no smooth transition, etc.
{F5956124}
//Before: the window is not smoothly dimmed.//
{F5956127}
//After: the window is smoothly dimmed.//
In combination with an effect that animates the disappearing of windows,
e.g. Glide, the rewritten Dim Inactive effect doesn't "flash" windows.
If an active window has been closed, it will stay bright. If an inactive
window has been closed, it will stay dimmed.
Among other changes, the KCM has been re-designed to follow common KCM
design in Plasma:
{F5956128, layout=center, size=full}
The way the rewritten Dim Inactive effect handles flashing/flickering problem can be
reused in the Dialog Parent effect.
### Demo
{F5959885}
//Before: dimming of a window group.//
{F5959886}
//After: Dimming of a window group.//
Depends on D13740
CCBUG: 359251
Test Plan:
Test plan #1
* Activated the Desktop Grid effect
* Dimmed windows smoothly brightened
* Left desktop grid
* Windows dimmed back
Test plan #2
* Opened Dolphin and its Preferences window
* Clicked on desktop, both Dolphin and the Preferences window dimmed
* Clicked on Dolphin, both windows smoothly brightened back
Reviewers: #kwin, #plasma, #vdg, davidedmundson
Reviewed By: #kwin, #plasma, #vdg, davidedmundson
Subscribers: davidedmundson, abetts, ngraham, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D13720
2018-06-20 10:16:31 +00:00
|
|
|
} // namespace KWin
|