[gnome-software/gnome-3-30] Have shell advance from LOADING to OVERVIEW by itself



commit feffb5718652d41ba4f15950514e326240d11a22
Author: Robert McQueen <rob endlessm com>
Date:   Wed Oct 10 15:26:27 2018 +0100

    Have shell advance from LOADING to OVERVIEW by itself
    
    Have the shell leave the LOADING state by itself once the refresh is completed,
    avoiding confusing coupling between GsApplication and GsShell. This is done
    conditionally, after the "loaded" signal emission so that if GsApplication has
    a queued mode change (from --mode=...) this is respected and un-necessary mode
    changes are avoided.

 src/gs-application.c | 2 +-
 src/gs-shell.c       | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 572e4746..9408885a 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -247,7 +247,7 @@ theme_changed (GtkSettings *settings, GParamSpec *pspec, GsApplication *app)
 static void
 gs_application_shell_loaded_cb (GsShell *shell, GsApplication *app)
 {
-       gs_shell_set_mode (app->shell, GS_SHELL_MODE_OVERVIEW);
+       g_signal_handler_disconnect (app->shell, app->shell_loaded_handler_id);
        app->shell_loaded_handler_id = 0;
 }
 
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 2d790b57..e785cab8 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -560,6 +560,10 @@ initial_overview_load_done (GsOverviewPage *overview_page, gpointer data)
        gs_page_reload (page);
 
        g_signal_emit (shell, signals[SIGNAL_LOADED], 0);
+
+       /* go to OVERVIEW, unless the "loading" callbacks changed mode already */
+       if (priv->mode == GS_SHELL_MODE_LOADING)
+               gs_shell_change_mode (shell, GS_SHELL_MODE_OVERVIEW, NULL, TRUE);
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]