File nautilus-212649-search-bar-visibility.patch of Package nautilus

This patch fixes a problem in which the search bar is not visible and it's not
obvious how to search when you navigate directly to the x-nautilus-search:///
URI.  This also fixes a problem in which focus is stolen away from the search
bar when the window is first displayed.

This is filed upstream at http://bugzilla.gnome.org/368424

Index: src/nautilus-navigation-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-navigation-window.c,v
retrieving revision 1.450
diff -u -p -u -r1.450 nautilus-navigation-window.c
--- src/nautilus-navigation-window.c	2 Oct 2006 10:53:58 -0000	1.450
+++ src/nautilus-navigation-window.c	31 Oct 2006 17:53:23 -0000
@@ -1128,8 +1128,7 @@ real_set_search_mode (NautilusWindow *wi
 		query_editor = nautilus_query_editor_new (TRUE,
 							  nautilus_search_directory_is_indexed (search_directory));
 	} else {
-		nautilus_navigation_window_show_location_bar_temporarily (nav_window);
-		nautilus_navigation_window_set_bar_mode (nav_window, NAUTILUS_BAR_SEARCH);
+		nautilus_navigation_window_show_search (nav_window);
 		nav_window->details->temporary_search_bar = FALSE;
 
 		query_editor = nautilus_query_editor_new_with_bar (FALSE,
@@ -1145,7 +1144,7 @@ real_set_search_mode (NautilusWindow *wi
 		nautilus_query_editor_set_query (NAUTILUS_QUERY_EDITOR (query_editor),
 						 query);
 		g_object_unref (query);
-	}else {
+	} else {
 		nautilus_query_editor_set_default_query (NAUTILUS_QUERY_EDITOR (query_editor));
 	}
 	
@@ -1466,16 +1465,18 @@ nautilus_navigation_window_show (GtkWidg
 		nautilus_navigation_window_hide_toolbar (window);
 	}
 
-	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR)) {
-		nautilus_navigation_window_show_location_bar (window, FALSE);
-	} else {
-		nautilus_navigation_window_hide_location_bar (window, FALSE);
-	}
-
-	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY)) {
-		nautilus_navigation_window_set_bar_mode (window, NAUTILUS_BAR_NAVIGATION);
-	} else {
-		nautilus_navigation_window_set_bar_mode (window, NAUTILUS_BAR_PATH);
+	if (! nautilus_navigation_window_search_bar_showing (window)) {
+		if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR)) {
+			nautilus_navigation_window_show_location_bar (window, FALSE);
+		} else {
+			nautilus_navigation_window_hide_location_bar (window, FALSE);
+		}
+
+		if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY)) {
+			nautilus_navigation_window_set_bar_mode (window, NAUTILUS_BAR_NAVIGATION);
+		} else {
+			nautilus_navigation_window_set_bar_mode (window, NAUTILUS_BAR_PATH);
+		}
 	}
 	
 	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_START_WITH_SIDEBAR)) {
@@ -1491,6 +1492,11 @@ nautilus_navigation_window_show (GtkWidg
 	}
 
 	GTK_WIDGET_CLASS (parent_class)->show (widget);
+
+	/* Lame hack to ensure that the icon view doesn't steal the focus away */
+	if (nautilus_navigation_window_search_bar_showing (window)) {
+		nautilus_search_bar_grab_focus (NAUTILUS_SEARCH_BAR (window->search_bar));
+	}
 }
 
 static void
openSUSE Build Service is sponsored by