[gnome-software/gnome-40: 1/2] gs-shell: Overview page opens empty with "Automatic Updates" off




commit f6a49b3578d1f5d7d872b216942dde3291c4c7ba
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 15 09:55:44 2021 +0200

    gs-shell: Overview page opens empty with "Automatic Updates" off
    
    When the "Automatic Updates" are off, the shell window switches to
    the overview page immediately. Since some recent change the preselected
    page is the Overview page, thus the switch to it doesn't call reload(),
    thus it is left empty. To adapt to the new behavior call reload() also
    when the Overview page had been already selected. It's okay, because
    it's only after the initial start.
    
    Non-trivial cherry-pick of 80fc7459 to `gnome-40`.
    
    Fixes: #1070

 src/gs-shell.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 4a4e0a2da..cecbbe1bd 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -805,14 +805,17 @@ initial_refresh_done (GsLoadingPage *loading_page, gpointer data)
 {
        GsShell *shell = data;
        GsShellPrivate *priv = gs_shell_get_instance_private (shell);
+       gboolean been_overview;
 
        g_signal_handlers_disconnect_by_func (loading_page, initial_refresh_done, data);
 
+       been_overview = priv->mode == GS_SHELL_MODE_OVERVIEW;
+
        g_signal_emit (shell, signals[SIGNAL_LOADED], 0);
 
        /* if the "loaded" signal handler didn't change the mode, kick off async
         * overview page refresh, and switch to the page once done */
-       if (priv->mode == GS_SHELL_MODE_LOADING) {
+       if (priv->mode == GS_SHELL_MODE_LOADING || been_overview) {
                GsPage *page;
 
                page = GS_PAGE (gtk_builder_get_object (priv->builder, "overview_page"));


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