[gnome-software/gnome-3-14] Make sure back button always leads back to overview



commit ceb8fb440e76ca077b713dee3541e208a9e47f93
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri Dec 12 16:22:59 2014 +0100

    Make sure back button always leads back to overview
    
    When gnome-software is launched in the details view, the back button
    should normally lead back to the main view.
    
    However, this didn't work when gnome-software window had previously been
    closed in a different view; when relaunched, gnome-software would then
    remember the last view from the previous run and the back button would
    go back there instead of the overview mode.
    
    Fix this by making sure we reset the internal state when closing the
    main window.

 src/gs-shell.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 29279f2..5219878 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -472,6 +472,10 @@ main_window_closed_cb (GtkWidget *dialog, GdkEvent *event, gpointer user_data)
        GsShellPrivate *priv = shell->priv;
        BackEntry *entry;
 
+       /* When the window is closed, reset the initial mode to overview */
+       priv->mode = GS_SHELL_MODE_OVERVIEW;
+
+       /* ... and clear any remaining entries in the back button stack */
        while ((entry = g_queue_pop_head (priv->back_entry_stack)) != NULL) {
                free_back_entry (entry);
        }


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