summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2014-01-31 14:14:10 +0100
committerBastien Nocera <hadess@hadess.net>2014-01-31 14:15:34 +0100
commit549157c9df9efda0d4bb3519e7aa50a6d4c85511 (patch)
tree13afbdcab75d26cceed1c5744c14672767328e18
parenta7b92ac4b617d08e58e86e9f516e089b1fcd230f (diff)
downloadtotem-549157c9df9efda0d4bb3519e7aa50a6d4c85511.tar.gz
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
-rw-r--r--src/totem-grilo.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 36b1fbd5a..62ae9c7e2 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);
}