summaryrefslogtreecommitdiff
path: root/src/nautilus-window-slot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-window-slot.c')
-rw-r--r--src/nautilus-window-slot.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index b10de0034..f775a14f3 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -249,14 +249,13 @@ nautilus_window_slot_content_view_matches (NautilusWindowSlot *slot,
}
static void
-check_search_visible (NautilusWindowSlot *slot)
+update_search_visible (NautilusWindowSlot *slot)
{
NautilusQuery *query;
NautilusView *view;
gchar *text;
GAction *action;
- query = nautilus_query_editor_get_query (slot->details->query_editor);
action = g_action_map_lookup_action (G_ACTION_MAP (slot->details->slot_action_group),
"search-visible");
/* Don't allow search on desktop */
@@ -265,10 +264,15 @@ check_search_visible (NautilusWindowSlot *slot)
view = nautilus_window_slot_get_current_view (slot);
/* If we changed location just to another search location, for example,
- * when changing the query, just keep the search visible */
- if (nautilus_view_is_searching (view))
+ * when changing the query, just keep the search visible.
+ * Make sure the search is visible though, since we could be returning
+ * from a previous search location when using the history */
+ if (nautilus_view_is_searching (view)) {
+ nautilus_window_slot_set_search_visible (slot, TRUE);
return;
+ }
+ query = nautilus_query_editor_get_query (slot->details->query_editor);
if (query) {
text = nautilus_query_get_text (query);
/* If the view is not searching, but search is visible, and the
@@ -295,10 +299,10 @@ nautilus_window_slot_sync_actions (NautilusWindowSlot *slot)
return;
}
- /* Check if we need to close the search or not after changing the location.
+ /* Check if we need to close the search or show search after changing the location.
* Needs to be done after the change has been done, if not, a loop happens,
* because setting the search enabled or not actually opens a location */
- check_search_visible (slot);
+ update_search_visible (slot);
/* Files view mode */
action = g_action_map_lookup_action (G_ACTION_MAP (slot->details->slot_action_group), "files-view-mode");