fix(kwin): skip launcher opening animation

main
Reion Wong 3 weeks ago
parent d27d634fc0
commit 216d914ec0

@ -9,31 +9,11 @@
"use strict"; "use strict";
var blocklist = [
// Ignore the black background behind the lock screen.
"ksmserver ksmserver",
// The logout screen has to be animated only by the logout effect.
"ksmserver-logout-greeter ksmserver-logout-greeter",
// The lock screen isn't a popup window.
"kscreenlocker_greet kscreenlocker_greet",
// KDE Plasma splash screen has to be animated only by the login effect.
"ksplashqml ksplashqml",
// The shell's own surfaces: panels, the desktop and the launcher. The
// launcher used to be faded in here, back when it was its own process with
// its own window class; it animates itself now.
"cutefish-shell cutefish-shell"
];
var allowlist = [ var allowlist = [
"cutefish-screenshot cutefish-screenshot" "cutefish-screenshot cutefish-screenshot"
]; ];
function isPopupWindow(window) { function isPopupWindow(window) {
// If the window is blocklisted, don't animate it.
if (blocklist.indexOf(window.windowClass) != -1) {
return false;
}
if (allowlist.indexOf(window.windowClass) != -1) { if (allowlist.indexOf(window.windowClass) != -1) {
return true; return true;
} }
@ -81,7 +61,7 @@ function isPopupWindow(window) {
var cutefishPopupsEffect = { var cutefishPopupsEffect = {
loadConfig: function () { loadConfig: function () {
cutefishPopupsEffect.fadeInDuration = animationTime(100); cutefishPopupsEffect.fadeInDuration = animationTime(100);
cutefishPopupsEffect.fadeOutDuration = animationTime(100) * 4; cutefishPopupsEffect.fadeOutDuration = animationTime(100);
}, },
slotWindowAdded: function (window) { slotWindowAdded: function (window) {
if (effects.hasActiveFullScreenEffect) { if (effects.hasActiveFullScreenEffect) {

@ -10,24 +10,12 @@
"use strict"; "use strict";
var blocklist = [ function isCutefishShell(window) {
// The logout screen has to be animated only by the logout effect. return window.windowClass
"ksmserver ksmserver", .toLowerCase()
"ksmserver-logout-greeter ksmserver-logout-greeter", .split(/\s+/)
.indexOf("cutefish-shell") !== -1;
// KDE Plasma splash screen has to be animated only by the login effect. }
"ksplashqml ksplashqml",
// Screenshot tools have to stay out of their own screenshots.
"spectacle spectacle",
"spectacle org.kde.spectacle",
// The status bar, the dock, the launcher and the desktop are one process
// and share this window class. None of them wants a scale animation: they
// are panels and overlays, and the launcher brings its own.
"cutefish-shell cutefish-shell",
"cutefish-screenshot cutefish-screenshot"
];
var scaleEffect = { var scaleEffect = {
loadConfig: function () { loadConfig: function () {
@ -40,21 +28,6 @@ var scaleEffect = {
scaleEffect.outOpacity = 0.0; scaleEffect.outOpacity = 0.0;
}, },
isScaleWindow: function (window) { isScaleWindow: function (window) {
// 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 (window.windowClass == "plasmashell plasmashell"
|| window.windowClass == "plasmashell org.kde.plasmashell") {
return window.hasDecoration;
}
if (blocklist.indexOf(window.windowClass) != -1) {
return false;
}
if (window.hasDecoration) { if (window.hasDecoration) {
return true; return true;
} }
@ -86,6 +59,9 @@ var scaleEffect = {
window.setData(Effect.WindowForceBlurRole, null); window.setData(Effect.WindowForceBlurRole, null);
}, },
slotWindowAdded: function (window) { slotWindowAdded: function (window) {
if (isCutefishShell(window) && window.caption === "Launcher") {
return;
}
if (effects.hasActiveFullScreenEffect) { if (effects.hasActiveFullScreenEffect) {
return; return;
} }

Loading…
Cancel
Save