Skip to content

Commit

Permalink
windowManager.js: get rid of (non-cinnamon) popup menu animations.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtwebster committed Aug 9, 2022
1 parent 7186686 commit e2157df
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions js/ui/windowManager.js
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e2157df

Please sign in to comment.