PanelClone: avoid using Timeout (#2015)

Co-authored-by: Ryan Kornheisl <ryan@skarva.tech>
Co-authored-by: Leonhard <106322251+leolost2605@users.noreply.github.com>
This commit is contained in:
Leo 2024-11-26 18:07:10 +03:00 committed by GitHub
parent 2f95be4c8d
commit 5adb5544f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,18 +146,21 @@ public class Gala.PanelClone : Object {
return;
}
var animation_duration = get_animation_duration ();
clone.save_easing_state ();
clone.set_easing_mode (Clutter.AnimationMode.EASE_OUT_QUAD);
clone.set_easing_duration (animation_duration);
clone.set_easing_duration (get_animation_duration ());
clone.y = calculate_clone_y (false);
clone.restore_easing_state ();
Timeout.add (animation_duration, () => {
unowned var y_transition = clone.get_transition ("y");
if (y_transition != null) {
y_transition.completed.connect (() => {
clone.visible = false;
panel_hidden = false;
return Source.REMOVE;
});
} else {
clone.visible = false;
panel_hidden = false;
}
}
}