[PATCH] After switching from iconview to listview the typeahead is not triggered in listview



The attached patch is meant to fix bug 329087[1].

[1] http://bugzilla.gnome.org/show_bug.cgi?id=329087
Index: libnautilus-private/nautilus-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-view.c,v
retrieving revision 1.3
diff -p -u -r1.3 nautilus-view.c
--- libnautilus-private/nautilus-view.c	17 May 2005 13:27:29 -0000	1.3
+++ libnautilus-private/nautilus-view.c	29 Jan 2006 12:57:56 -0000
@@ -251,6 +251,16 @@ nautilus_view_get_zoom_level (NautilusVi
 }
 
 void
+nautilus_view_grab_focus (NautilusView   *view)
+{
+	g_return_if_fail (NAUTILUS_IS_VIEW (view));
+
+	if (NAUTILUS_VIEW_GET_IFACE (view)->grab_focus != NULL) {
+		(* NAUTILUS_VIEW_GET_IFACE (view)->grab_focus) (view);
+	}
+}
+
+void
 nautilus_view_pop_up_location_context_menu (NautilusView   *view,
 					    GdkEventButton *event)
 {
Index: libnautilus-private/nautilus-view.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-view.h,v
retrieving revision 1.3
diff -p -u -r1.3 nautilus-view.h
--- libnautilus-private/nautilus-view.h	17 May 2005 13:27:29 -0000	1.3
+++ libnautilus-private/nautilus-view.h	29 Jan 2006 12:57:56 -0000
@@ -106,6 +106,8 @@ struct _NautilusViewIface 
         gboolean       (* can_zoom_in)	 	  (NautilusView          *view);
         gboolean       (* can_zoom_out)	 	  (NautilusView          *view);
 
+        void           (* grab_focus)             (NautilusView          *view);
+
 	/* Request popup of context menu referring to the open location.
 	 * This is triggered in spatial windows by right-clicking the location button,
 	 * in navigational windows by right-clicking the "Location:" label in the
@@ -151,6 +153,7 @@ gboolean          nautilus_view_can_zoom
 NautilusZoomLevel nautilus_view_get_zoom_level             (NautilusView      *view);
 void              nautilus_view_pop_up_location_context_menu (NautilusView    *view,
 							      GdkEventButton  *event);
+void              nautilus_view_grab_focus                 (NautilusView      *view);
 
 G_END_DECLS
 
Index: src/nautilus-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.c,v
retrieving revision 1.459
diff -p -u -r1.459 nautilus-window.c
--- src/nautilus-window.c	21 Jan 2006 23:19:50 -0000	1.459
+++ src/nautilus-window.c	29 Jan 2006 12:57:59 -0000
@@ -1224,6 +1224,9 @@ nautilus_window_set_content_view_widget 
 	
 	EEL_CALL_METHOD (NAUTILUS_WINDOW_CLASS, window,
                          set_content_view_widget, (window, frame));
+
+	if (NAUTILUS_VIEW_GET_IFACE (frame)->grab_focus != NULL)
+		(* NAUTILUS_VIEW_GET_IFACE (frame)->grab_focus) (frame);
 }
 
 /**
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.264
diff -p -u -r1.264 fm-list-view.c
--- src/file-manager/fm-list-view.c	26 Jan 2006 21:25:07 -0000	1.264
+++ src/file-manager/fm-list-view.c	29 Jan 2006 12:58:03 -0000
@@ -2465,6 +2465,12 @@ list_view_scroll_to_file (NautilusView *
 	}
 }
 
+static void
+fm_list_view_grab_focus (NautilusView *view)
+{
+	gtk_widget_grab_focus (GTK_WIDGET (FM_LIST_VIEW (view)->details->tree_view));
+}
+
 
 static void
 fm_list_view_class_init (FMListViewClass *class)
@@ -2536,6 +2542,7 @@ fm_list_view_iface_init (NautilusViewIfa
 	iface->get_first_visible_file = fm_list_view_get_first_visible_file;
 	iface->scroll_to_file = list_view_scroll_to_file;
 	iface->get_title = NULL;
+	iface->grab_focus = fm_list_view_grab_focus;
 }
 
 


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