[gnome-software/1395-mode-change-from-command-line-does-not-always-stick] gs-shell: Switch to the overview page only when on the loading page after start



commit 379cc45abd9c898a5a617a70085f619911b48d2f
Author: Milan Crha <mcrha redhat com>
Date:   Fri Sep 10 14:02:07 2021 +0200

    gs-shell: Switch to the overview page only when on the loading page after start
    
    Switch only when still on the loading page, otherwise the page could be changed
    from the command line or such, which would mean hiding the chosen page.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1395

 src/gs-shell.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index d81657d38..18c9e98f4 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -852,7 +852,11 @@ change_mode_idle (gpointer user_data)
        gs_page_reload (GS_PAGE (shell->pages[GS_SHELL_MODE_UPDATES]));
        gs_page_reload (GS_PAGE (shell->pages[GS_SHELL_MODE_INSTALLED]));
 
-       gs_shell_change_mode (shell, GS_SHELL_MODE_OVERVIEW, NULL, TRUE);
+       /* Switch only when still on the loading page, otherwise the page
+          could be changed from the command line or such, which would mean
+          hiding the chosen page. */
+       if (gs_shell_get_mode (shell) == GS_SHELL_MODE_LOADING)
+               gs_shell_change_mode (shell, GS_SHELL_MODE_OVERVIEW, NULL, TRUE);
 
        return G_SOURCE_REMOVE;
 }


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