From 11e9fbf264f81851878c4978130aae420ff8b731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 18 Jan 2024 18:15:19 +0100 Subject: [PATCH] windowManager: Fix effects of transient wayland windows On wayland, transient windows don't use the DIALOG window type, so any effects that special-case dialogs currently pick the wrong animation. Fix that with an "animation window type" that is used instead of the real type. Part-of: --- js/ui/windowManager.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 6af225f14..7603a8ed0 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -1124,6 +1124,21 @@ export class WindowManager { this._allowedKeybindings[name] = modes; } + _getAnimationWindowType(actor) { + const {metaWindow: window} = actor; + const {windowType} = window; + + if (windowType !== Meta.WindowType.NORMAL || + window.get_client_type() === Meta.WindowClientType.X11) + return windowType; + + // wayland doesn't use the DIALOG type, but for + // animations we want transients to behave like ones + return window.get_transient_for() != null + ? Meta.WindowType.DIALOG + : windowType; + } + _shouldAnimate() { const overviewOpen = Main.overview.visible && !Main.overview.closing; return !(overviewOpen || this._workspaceAnimation.gestureActive); @@ -1139,7 +1154,7 @@ export class WindowManager { if (!actor.get_texture()) return false; - let type = actor.meta_window.get_window_type(); + const type = this._getAnimationWindowType(actor); return types.includes(type); } @@ -1487,7 +1502,7 @@ export class WindowManager { return; } - switch (actor._windowType) { + switch (this._getAnimationWindowType(actor)) { case Meta.WindowType.NORMAL: actor.set_pivot_point(0.5, 1.0); actor.scale_x = 0.01; @@ -1563,7 +1578,7 @@ export class WindowManager { return; } - switch (actor.meta_window.window_type) { + switch (this._getAnimationWindowType(actor)) { case Meta.WindowType.NORMAL: actor.set_pivot_point(0.5, 0.5); this._destroying.add(actor);