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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3125>
This commit is contained in:
Florian Müllner 2024-01-18 18:15:19 +01:00
parent 5ab3177acd
commit 11e9fbf264

View File

@ -1124,6 +1124,21 @@ export class WindowManager {
this._allowedKeybindings[name] = modes; 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() { _shouldAnimate() {
const overviewOpen = Main.overview.visible && !Main.overview.closing; const overviewOpen = Main.overview.visible && !Main.overview.closing;
return !(overviewOpen || this._workspaceAnimation.gestureActive); return !(overviewOpen || this._workspaceAnimation.gestureActive);
@ -1139,7 +1154,7 @@ export class WindowManager {
if (!actor.get_texture()) if (!actor.get_texture())
return false; return false;
let type = actor.meta_window.get_window_type(); const type = this._getAnimationWindowType(actor);
return types.includes(type); return types.includes(type);
} }
@ -1487,7 +1502,7 @@ export class WindowManager {
return; return;
} }
switch (actor._windowType) { switch (this._getAnimationWindowType(actor)) {
case Meta.WindowType.NORMAL: case Meta.WindowType.NORMAL:
actor.set_pivot_point(0.5, 1.0); actor.set_pivot_point(0.5, 1.0);
actor.scale_x = 0.01; actor.scale_x = 0.01;
@ -1563,7 +1578,7 @@ export class WindowManager {
return; return;
} }
switch (actor.meta_window.window_type) { switch (this._getAnimationWindowType(actor)) {
case Meta.WindowType.NORMAL: case Meta.WindowType.NORMAL:
actor.set_pivot_point(0.5, 0.5); actor.set_pivot_point(0.5, 0.5);
this._destroying.add(actor); this._destroying.add(actor);