diff --git a/scripts/cutefish_popups/contents/code/main.js b/scripts/cutefish_popups/contents/code/main.js index 1d29b4a..d14f780 100644 --- a/scripts/cutefish_popups/contents/code/main.js +++ b/scripts/cutefish_popups/contents/code/main.js @@ -9,31 +9,11 @@ "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 = [ "cutefish-screenshot cutefish-screenshot" ]; 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) { return true; } @@ -81,7 +61,7 @@ function isPopupWindow(window) { var cutefishPopupsEffect = { loadConfig: function () { cutefishPopupsEffect.fadeInDuration = animationTime(100); - cutefishPopupsEffect.fadeOutDuration = animationTime(100) * 4; + cutefishPopupsEffect.fadeOutDuration = animationTime(100); }, slotWindowAdded: function (window) { if (effects.hasActiveFullScreenEffect) { diff --git a/scripts/cutefish_scale/contents/code/main.js b/scripts/cutefish_scale/contents/code/main.js index 34ed9e3..e3e0790 100644 --- a/scripts/cutefish_scale/contents/code/main.js +++ b/scripts/cutefish_scale/contents/code/main.js @@ -10,24 +10,12 @@ "use strict"; -var blocklist = [ - // The logout screen has to be animated only by the logout effect. - "ksmserver ksmserver", - "ksmserver-logout-greeter ksmserver-logout-greeter", - - // 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" -]; +function isCutefishShell(window) { + return window.windowClass + .toLowerCase() + .split(/\s+/) + .indexOf("cutefish-shell") !== -1; +} var scaleEffect = { loadConfig: function () { @@ -40,21 +28,6 @@ var scaleEffect = { scaleEffect.outOpacity = 0.0; }, 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) { return true; } @@ -86,6 +59,9 @@ var scaleEffect = { window.setData(Effect.WindowForceBlurRole, null); }, slotWindowAdded: function (window) { + if (isCutefishShell(window) && window.caption === "Launcher") { + return; + } if (effects.hasActiveFullScreenEffect) { return; }