From 40103d6f4175ebe6c342d6bae2fc1e73a5da31f4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 15 Apr 2019 15:40:39 +0200 Subject: [PATCH] core: Account for completed sequences in feedback updates The sequences may stay completed in the list (eg. pending a focus request), it's then confusing to show the "wait" cursor icon until they are really gone. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/541 --- src/core/startup-notification.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c index 956238b10..abf4885f6 100644 --- a/src/core/startup-notification.c +++ b/src/core/startup-notification.c @@ -106,12 +106,26 @@ G_DEFINE_TYPE_WITH_PRIVATE (MetaStartupSequence, static void meta_startup_notification_ensure_timeout (MetaStartupNotification *sn); +static gboolean +meta_startup_notification_has_pending_sequences (MetaStartupNotification *sn) +{ + GSList *l; + + for (l = sn->startup_sequences; l; l = l->next) + { + if (!meta_startup_sequence_get_completed (l->data)) + return TRUE; + } + + return FALSE; +} + static void meta_startup_notification_update_feedback (MetaStartupNotification *sn) { MetaDisplay *display = sn->display; - if (sn->startup_sequences != NULL) + if (meta_startup_notification_has_pending_sequences (sn)) { meta_topic (META_DEBUG_STARTUP, "Setting busy cursor\n");