[totem] main: Fix back button not working after click



commit 549157c9df9efda0d4bb3519e7aa50a6d4c85511
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jan 31 14:14:10 2014 +0100

    main: Fix back button not working after click
    
    We were hiding then showing again the back button when
    clicking on "back" button, making it unclickable until we
    left and re-entered the button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722454

 src/totem-grilo.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 36b1fbd..62ae9c7 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -1450,7 +1450,11 @@ totem_grilo_back_button_clicked (TotemGrilo *self)
        g_object_get (G_OBJECT (self->priv->browser_filter_model), "virtual-root", &path, NULL);
        g_assert (path);
 
-       set_browser_filter_model_for_path (self, NULL);
+       /* We don't call set_browser_filter_model_for_path() to avoid
+        * the back button getting hidden and re-shown */
+       g_clear_object (&self->priv->browser_filter_model);
+       gd_main_view_set_model (GD_MAIN_VIEW (self->priv->browser), NULL);
+
        totem_main_toolbar_set_search_mode (TOTEM_MAIN_TOOLBAR (self->priv->header), FALSE);
        gd_main_view_set_selection_mode (GD_MAIN_VIEW (self->priv->browser), FALSE);
 
@@ -1470,8 +1474,10 @@ totem_grilo_back_button_clicked (TotemGrilo *self)
        }
 
        gtk_tree_path_up (path);
-       if (gtk_tree_path_get_depth (path) > 0)
+       if (path != NULL && gtk_tree_path_get_depth (path) > 0)
                set_browser_filter_model_for_path (self, path);
+       else
+               set_browser_filter_model_for_path (self, NULL);
        gtk_tree_path_free (path);
 }
 


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