Skip to content

Commit 744fe63

Browse files
authored
Merge branch 'main' into lenemter/remove-ccode
2 parents 3211923 + 8e28dc0 commit 744fe63

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
@@ -578,88 +578,6 @@ namespace Gala {
578578
InternalUtils.set_input_area (display, InputArea.DEFAULT);
579579
}
580580

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

13271245
// Notifications initial animation is handled by the notification stack
1328-
if (NotificationStack.is_notification (window)) {
1246+
if (NotificationStack.is_notification (window) || !Meta.Prefs.get_gnome_animations ()) {
13291247
map_completed (actor);
13301248
return;
13311249
}
13321250

1333-
if (!Meta.Prefs.get_gnome_animations ()) {
1334-
map_completed (actor);
1335-
1336-
if (Utils.get_window_is_normal (window) && window.get_layer () == Meta.StackLayer.BOTTOM) {
1337-
show_bottom_stack_window (window);
1338-
}
1339-
1340-
return;
1341-
}
1342-
13431251
switch (window.window_type) {
13441252
case Meta.WindowType.NORMAL:
13451253
var duration = AnimationDuration.HIDE;
@@ -1371,10 +1279,6 @@ namespace Gala {
13711279
actor.disconnect (map_handler_id);
13721280
mapping.remove (actor);
13731281
map_completed (actor);
1374-
1375-
if (window.get_layer () == Meta.StackLayer.BOTTOM) {
1376-
show_bottom_stack_window (window);
1377-
}
13781282
});
13791283
break;
13801284
case Meta.WindowType.MENU:
@@ -1424,10 +1328,6 @@ namespace Gala {
14241328
actor.disconnect (map_handler_id);
14251329
mapping.remove (actor);
14261330
map_completed (actor);
1427-
1428-
if (window.get_layer () == Meta.StackLayer.BOTTOM) {
1429-
show_bottom_stack_window (window);
1430-
}
14311331
});
14321332

14331333
dim_parent_window (window);

0 commit comments

Comments
 (0)