fix(scripts): match the merged cutefish-shell window class

main
Reion Wong 3 weeks ago
parent a8bec6384e
commit 3cbf61be7b

@ -17,11 +17,14 @@ var blocklist = [
// 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"
"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-launcher cutefish-launcher",
"cutefish-screenshot cutefish-screenshot"
];

@ -22,8 +22,10 @@ var blocklist = [
"spectacle spectacle",
"spectacle org.kde.spectacle",
"cutefish-launcher cutefish-launcher",
"cutefish-statusbar cutefish-statusbar",
// 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"
];

@ -1,17 +1,54 @@
"use strict";
// KWin never lets an ordinary window grow past the work area, and since the
// status bar and the dock now reserve work area on Wayland as well, the
// launcher would come up as a screen-sized window trimmed by both struts. It is
// a full-screen overlay, so it is forced back onto the whole screen area here.
//
// It stays an ordinary window on purpose: a real full-screen window would be
// stacked above the dock, and the dock is meant to float on top of the
// launcher. The status bar drops below it on its own while the launcher is up.
function forceFullScreen(window) {
var screenGeometry = workspace.clientArea(KWin.ScreenArea, window);
window.frameGeometry = screenGeometry;
if (window.frameGeometry.x !== screenGeometry.x
|| window.frameGeometry.y !== screenGeometry.y
|| window.frameGeometry.width !== screenGeometry.width
|| window.frameGeometry.height !== screenGeometry.height) {
window.frameGeometry = screenGeometry;
}
}
function isLauncher(window) {
if (window.dialog) {
return false;
}
// The status bar, the dock, the launcher and the desktop are one process
// since 0.9, so they all share a resource class and only the window title
// tells them apart. The standalone binary is still matched for older
// sessions.
if (window.resourceClass === "cutefish-shell") {
return window.caption === "Launcher";
}
return window.resourceClass === "cutefish-launcher"
&& window.resourceName === "cutefish-launcher";
}
function setupConnection(window) {
if (window.resourceClass != "cutefish-launcher"
|| window.resourceName != "cutefish-launcher" || window.dialog) {
if (!isLauncher(window)) {
return;
}
// Belt and braces for whichever open/close animation effect is enabled:
// the launcher is a full-screen overlay that animates its own contents, so
// having the compositor scale or fade the whole surface on top of that
// looks wrong. The scale and popup effects skip it by window class too.
window.skipsCloseAnimation = true;
forceFullScreen(window);
window.frameGeometryChanged.connect(function () {
forceFullScreen(window);
});

Loading…
Cancel
Save