Skip to content

Commit 1b862b2

Browse files
authored
Merge branch 'main' into lenemter/cleanup-window-switcher
2 parents 4d85605 + 8e28dc0 commit 1b862b2

File tree

2 files changed

+1
-112
lines changed

2 files changed

+1
-112
lines changed

src/InternalUtils.vala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,6 @@ namespace Gala {
9191
workspace_manager.thaw_remove ();
9292
}
9393

94-
public static inline bool get_window_is_normal (Meta.Window window) {
95-
switch (window.window_type) {
96-
case Meta.WindowType.NORMAL:
97-
case Meta.WindowType.DIALOG:
98-
case Meta.WindowType.MODAL_DIALOG:
99-
return true;
100-
default:
101-
return false;
102-
}
103-
}
104-
10594
public static Clutter.ActorBox actor_box_from_rect (float x, float y, float width, float height) {
10695
var actor_box = Clutter.ActorBox ();
10796
actor_box.init_rect (x, y, width, height);

src/WindowManager.vala

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -584,88 +584,6 @@ namespace Gala {
584584
InternalUtils.set_input_area (display, InputArea.DEFAULT);
585585
}
586586

587-
private void show_bottom_stack_window (Meta.Window bottom_window) {
588-
unowned var workspace = bottom_window.get_workspace ();
589-
if (Utils.get_n_windows (workspace) == 0) {
590-
return;
591-
}
592-
593-
unowned var bottom_actor = (Meta.WindowActor) bottom_window.get_compositor_private ();
594-
if (Meta.Prefs.get_gnome_animations ()) {
595-
animate_bottom_window_scale (bottom_actor);
596-
}
597-
598-
uint fade_out_duration = 900U;
599-
double[] op_keyframes = { 0.1, 0.9 };
600-
GLib.Value[] opacity = { 20U, 20U };
601-
#if HAS_MUTTER46
602-
unowned Meta.Display display = get_display ();
603-
unowned Meta.X11Display x11display = display.get_x11_display ();
604-
var bottom_xwin = x11display.lookup_xwindow (bottom_window);
605-
#else
606-
var bottom_xwin = bottom_window.get_xwindow ();
607-
#endif
608-
609-
workspace.list_windows ().@foreach ((window) => {
610-
#if HAS_MUTTER46
611-
var xwin = x11display.lookup_xwindow (window);
612-
#else
613-
var xwin = window.get_xwindow ();
614-
#endif
615-
if (xwin == bottom_xwin
616-
|| !Utils.get_window_is_normal (window)
617-
|| window.minimized) {
618-
return;
619-
}
620-
621-
unowned var actor = (Meta.WindowActor) window.get_compositor_private ();
622-
if (Meta.Prefs.get_gnome_animations ()) {
623-
var op_trans = new Clutter.KeyframeTransition ("opacity") {
624-
duration = fade_out_duration,
625-
remove_on_complete = true,
626-
progress_mode = Clutter.AnimationMode.EASE_IN_OUT_QUAD
627-
};
628-
op_trans.set_from_value (255.0f);
629-
op_trans.set_to_value (255.0f);
630-
op_trans.set_key_frames (op_keyframes);
631-
op_trans.set_values (opacity);
632-
633-
actor.add_transition ("opacity-hide", op_trans);
634-
} else {
635-
Timeout.add ((uint)(fade_out_duration * op_keyframes[0]), () => {
636-
actor.opacity = (uint)opacity[0];
637-
return GLib.Source.REMOVE;
638-
});
639-
640-
Timeout.add ((uint)(fade_out_duration * op_keyframes[1]), () => {
641-
actor.opacity = 255U;
642-
return GLib.Source.REMOVE;
643-
});
644-
}
645-
});
646-
}
647-
648-
private void animate_bottom_window_scale (Meta.WindowActor actor) {
649-
const string[] PROPS = { "scale-x", "scale-y" };
650-
651-
foreach (string prop in PROPS) {
652-
double[] scale_keyframes = { 0.2, 0.3, 0.8 };
653-
GLib.Value[] scale = { 1.0f, 1.07f, 1.07f };
654-
655-
var scale_trans = new Clutter.KeyframeTransition (prop) {
656-
duration = 500,
657-
remove_on_complete = true,
658-
progress_mode = Clutter.AnimationMode.EASE_IN_QUAD
659-
};
660-
scale_trans.set_from_value (1.0f);
661-
scale_trans.set_to_value (1.0f);
662-
scale_trans.set_key_frames (scale_keyframes);
663-
scale_trans.set_values (scale);
664-
665-
actor.add_transition ("magnify-%s".printf (prop), scale_trans);
666-
}
667-
}
668-
669587
/**
670588
* {@inheritDoc}
671589
*/
@@ -1331,21 +1249,11 @@ namespace Gala {
13311249
actor.show ();
13321250

13331251
// Notifications initial animation is handled by the notification stack
1334-
if (NotificationStack.is_notification (window)) {
1252+
if (NotificationStack.is_notification (window) || !Meta.Prefs.get_gnome_animations ()) {
13351253
map_completed (actor);
13361254
return;
13371255
}
13381256

1339-
if (!Meta.Prefs.get_gnome_animations ()) {
1340-
map_completed (actor);
1341-
1342-
if (Utils.get_window_is_normal (window) && window.get_layer () == Meta.StackLayer.BOTTOM) {
1343-
show_bottom_stack_window (window);
1344-
}
1345-
1346-
return;
1347-
}
1348-
13491257
switch (window.window_type) {
13501258
case Meta.WindowType.NORMAL:
13511259
var duration = AnimationDuration.HIDE;
@@ -1377,10 +1285,6 @@ namespace Gala {
13771285
actor.disconnect (map_handler_id);
13781286
mapping.remove (actor);
13791287
map_completed (actor);
1380-
1381-
if (window.get_layer () == Meta.StackLayer.BOTTOM) {
1382-
show_bottom_stack_window (window);
1383-
}
13841288
});
13851289
break;
13861290
case Meta.WindowType.MENU:
@@ -1430,10 +1334,6 @@ namespace Gala {
14301334
actor.disconnect (map_handler_id);
14311335
mapping.remove (actor);
14321336
map_completed (actor);
1433-
1434-
if (window.get_layer () == Meta.StackLayer.BOTTOM) {
1435-
show_bottom_stack_window (window);
1436-
}
14371337
});
14381338

14391339
dim_parent_window (window);

0 commit comments

Comments
 (0)