From e2157dfb7389bcc9044ad832c88e949fc21d76f2 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Thu, 4 Aug 2022 11:47:41 -0400 Subject: [PATCH] windowManager.js: get rid of (non-cinnamon) popup menu animations. Many apps handle their own popup rendering, so any effects we do here wouldn't apply. For example chromium/chrome and anything chromium-based (electron apps, etc...). The specific effect is different from Cinnamon popups, which are generally anchored to a panel, and unfortunately we can't distinguish Gtk dropdown menus from 'popup' ones (they report to muffin as the same type of window), so there's no way to give them more appropriate animations individually. --- js/ui/windowManager.js | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index f3cb461c69..96075ad883 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -411,7 +411,6 @@ var WindowManager = class WindowManager { case Meta.WindowType.MENU: case Meta.WindowType.DROPDOWN_MENU: case Meta.WindowType.POPUP_MENU: - return this.desktop_effects_menus; default: return false; } @@ -855,16 +854,9 @@ var WindowManager = class WindowManager { return; } - // menu effects are always fade-in/out - let overridden_types = [Meta.WindowType.MENU, - Meta.WindowType.DROPDOWN_MENU, - Meta.WindowType.POPUP_MENU ]; - this._mapping.add(actor); - let adjusted_type = overridden_types.includes(actor._windowType) ? "traditional" : this.desktop_effects_map_type; - - switch (adjusted_type) { + switch (this.desktop_effects_map_type) { case "traditional": { actor.orig_opacity = actor.opacity; @@ -876,11 +868,6 @@ var WindowManager = class WindowManager { let time = this.MAP_ANIMATION_TIME * this.window_effect_multiplier; - // Popups shouldn't be affected by the multiplier. - if (overridden_types.includes(actor._windowType)) { - time = this.MENU_ANIMATION_TIME; - } - actor.ease({ opacity: actor.orig_opacity, scale_x: 1, @@ -991,14 +978,7 @@ var WindowManager = class WindowManager { this._destroying.add(actor); - // menu effects are always traditional - let overridden_types = [Meta.WindowType.MENU, - Meta.WindowType.DROPDOWN_MENU, - Meta.WindowType.POPUP_MENU ]; - - let adjusted_type = overridden_types.includes(actor._windowType) ? "traditional" : this.desktop_effects_close_type; - - switch (adjusted_type) { + switch (this.desktop_effects_close_type) { case "fly": { let [xSrc, ySrc] = actor.get_position(); @@ -1047,10 +1027,6 @@ var WindowManager = class WindowManager { return; } - case Meta.WindowType.MENU: - case Meta.WindowType.DROPDOWN_MENU: - case Meta.WindowType.POPUP_MENU: - // ?? default: { this._destroyWindowDone(cinnamonwm, actor);