[gnome-software] Reload the current page again after closing and opening the main window



commit b9a39ee3705a47ab3da92a6cf4241d53c202a87d
Author: Kalev Lember <klember redhat com>
Date:   Wed Oct 10 11:47:54 2018 +0200

    Reload the current page again after closing and opening the main window
    
    When the main window is closed we clear the back button stack and set
    priv->mode to OVERVIEW_PAGE, but there was nothing that actually loaded
    the page for the newly set priv->mode when gnome-software was opened
    again. Instead, it just started in the previous mode. This led to issues
    where e.g. going to details page, closing gnome-software and opening it
    again resulted in the details page coming back up with the back button
    not working.
    
    This commit fixes this by making sure we clear the currently set page
    when shutting down, and reload it when activating gnome-software again.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/478
    Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/495

 src/gs-shell.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 1f5a0c9d..d179c25b 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -147,6 +147,11 @@ void
 gs_shell_activate (GsShell *shell)
 {
        GsShellPrivate *priv = gs_shell_get_instance_private (shell);
+
+       /* reload the page if we don't have anything currently loaded */
+       if (priv->page == NULL)
+               gs_shell_set_mode (shell, priv->mode);
+
        gtk_window_present (priv->main_window);
 }
 
@@ -780,6 +785,7 @@ main_window_closed_cb (GtkWidget *dialog, GdkEvent *event, gpointer user_data)
                                             "install-resources");
 
        /* When the window is closed, reset the initial mode to overview */
+       g_clear_object (&priv->page);
        priv->mode = GS_SHELL_MODE_OVERVIEW;
 
        gs_shell_clean_back_entry_stack (shell);


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