[PATCH] Make middle-click in navigation mode open a new window



Filed as part of [1], proposed patch attached. Another solution would
have been to make the alternate activation callbacks pass
NAUTILUS_WINDOW_OPEN_IN_NAVIGATION as mode, but it would IMHO have been
slighly confusing.

[1] http://ubuntuforums.org/showthread.php?t=75886

-- 
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-window-info.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-window-info.h,v
retrieving revision 1.4
diff -u -p -r1.4 nautilus-window-info.h
--- libnautilus-private/nautilus-window-info.h	1 Jul 2005 14:13:08 -0000	1.4
+++ libnautilus-private/nautilus-window-info.h	15 Oct 2005 20:34:35 -0000
@@ -47,7 +47,10 @@ typedef enum {
 } NautilusWindowOpenMode;
 
 typedef enum {
-	NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND = 1<<0
+	/* used in spatial mode */
+	NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND = 1<<0,
+	/* used in navigation mode */
+	NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW = 1<<1
 } NautilusWindowOpenFlags;
 
 typedef	enum {
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.354
diff -u -p -r1.354 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	9 Jul 2005 20:09:28 -0000	1.354
+++ src/nautilus-window-manage-views.c	15 Oct 2005 20:34:37 -0000
@@ -458,6 +458,11 @@ nautilus_window_open_location_full (Naut
 				} else {
 					NAUTILUS_SPATIAL_WINDOW (window)->affect_spatial_window_on_next_location_change = FALSE;
 				}
+			} else if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) != 0) {
+				target_window = nautilus_application_create_navigation_window 
+					(window->application,
+					 NULL,
+					 gtk_window_get_screen (GTK_WINDOW (window)));
 			}
 		} else if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
                         if (!NAUTILUS_SPATIAL_WINDOW (window)->affect_spatial_window_on_next_location_change) {
@@ -473,7 +478,12 @@ nautilus_window_open_location_full (Naut
                                 NAUTILUS_SPATIAL_WINDOW (window)->affect_spatial_window_on_next_location_change = FALSE;
                                 target_window = window;
                         }
-                } else {
+		} else if (flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) {
+			target_window = nautilus_application_create_navigation_window 
+				(window->application,
+				 NULL,
+				 gtk_window_get_screen (GTK_WINDOW (window)));
+		} else {
                         target_window = window;
                 }       
                 break;
Index: src/file-manager/fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.315
diff -u -p -r1.315 fm-icon-view.c
--- src/file-manager/fm-icon-view.c	19 Sep 2005 09:59:50 -0000	1.315
+++ src/file-manager/fm-icon-view.c	15 Oct 2005 20:34:37 -0000
@@ -1667,7 +1667,8 @@ icon_container_activate_alternate_callba
 	fm_directory_view_activate_files (FM_DIRECTORY_VIEW (icon_view), 
 					  file_list, 
 					  NAUTILUS_WINDOW_OPEN_ACCORDING_TO_MODE,
-					  NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND);
+					  NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND |
+					  NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW);
 }
 
 static void
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.258
diff -u -p -r1.258 fm-list-view.c
--- src/file-manager/fm-list-view.c	19 Sep 2005 11:57:42 -0000	1.258
+++ src/file-manager/fm-list-view.c	15 Oct 2005 20:34:38 -0000
@@ -235,7 +235,8 @@ activate_selected_items_alternate (FMLis
 	fm_directory_view_activate_files (FM_DIRECTORY_VIEW (view),
 					  file_list,
 					  NAUTILUS_WINDOW_OPEN_ACCORDING_TO_MODE,
-					  NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND);
+					  NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND |
+					  NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW);
 	nautilus_file_list_free (file_list);
 
 }

Attachment: signature.asc
Description: This is a digitally signed message part



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