From 3de6f7ebfe5ae5b3ed656e16f09a5ddd2145e0b7 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 15 Apr 2019 18:29:23 +0200 Subject: [PATCH] core: Emit MetaStartupNotification::changed on sequence completion This way handlers that want to know the get_complete() status will be able to do so without further delays. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/541 --- src/core/startup-notification.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c index 78edb47cf..4cd51aca6 100644 --- a/src/core/startup-notification.c +++ b/src/core/startup-notification.c @@ -424,12 +424,22 @@ meta_startup_sequence_get_wmclass (MetaStartupSequence *seq) return priv->wmclass; } +static void +on_sequence_completed (MetaStartupSequence *seq, + MetaStartupNotification *sn) +{ + meta_startup_notification_update_feedback (sn); + g_signal_emit (sn, sn_signals[CHANGED], 0, seq); +} + void meta_startup_notification_add_sequence (MetaStartupNotification *sn, MetaStartupSequence *seq) { sn->startup_sequences = g_slist_prepend (sn->startup_sequences, g_object_ref (seq)); + g_signal_connect (seq, "complete", + G_CALLBACK (on_sequence_completed), sn); meta_startup_notification_ensure_timeout (sn); meta_startup_notification_update_feedback (sn); @@ -519,6 +529,8 @@ meta_startup_notification_remove_sequence (MetaStartupNotification *sn, sn->startup_sequences = g_slist_remove (sn->startup_sequences, seq); meta_startup_notification_update_feedback (sn); + g_signal_handlers_disconnect_by_func (seq, on_sequence_completed, sn); + if (sn->startup_sequences == NULL && sn->startup_sequence_timeout != 0) {