[effects/glide] Don't animate the Application Dashboard

Summary:
The Glide effect should not animate the Application Dashboard because
it's not an ordinary application or a dialog. Same applies to Kickoff,
panel popups, etc.

The most obvious solution would be to add "plasmashell plasmashell"
window class to the blacklist, but we still would like to animate some
of plasmashell's windows, for example, Empty Trash Bin confirmation
dialog (if the trash bin icon is on the desktop).

One could notice that the Empty Trash Bin confirmation dialog, Task
Manager Settings window, and other plasmashell's windows that we want
to animate have decorations. So, we can use that as a heuristic.

Test Plan: Opened/closed the Application Dashboard.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14367
This commit is contained in:
Vlad Zagorodniy 2018-07-25 10:28:41 +03:00
parent cd6f56a443
commit a8563304f2

View file

@ -294,6 +294,16 @@ void GlideEffect::windowDataChanged(EffectWindow *w, int role)
bool GlideEffect::isGlideWindow(EffectWindow *w) const
{
// We don't want to animate most of plasmashell's windows, yet, some
// of them we want to, for example, Task Manager Settings window.
// The problem is that all those window share single window class.
// So, the only way to decide whether a window should be animated is
// to use a heuristic: if a window has decoration, then it's most
// likely a dialog or a settings window so we have to animate it.
if (w->windowClass() == QLatin1String("plasmashell plasmashell")) {
return w->hasDecoration();
}
if (s_blacklist.contains(w->windowClass())) {
return false;
}