diff options
author | Ernestas Kulik <ernestask@src.gnome.org> | 2016-10-18 06:28:50 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@src.gnome.org> | 2016-11-11 13:11:01 +0200 |
commit | 9106fab3c083463d1a5a76e58db7c56fa6fc83bf (patch) | |
tree | 77c01119a2385d204ba8c3729b80e066d915be95 /src/nautilus-application.c | |
parent | 37d6da00c799fe2cf475cc6ae80f95a03064b1bf (diff) | |
download | nautilus-9106fab3c083463d1a5a76e58db7c56fa6fc83bf.tar.gz |
application: open home directory on new window if searching
Opening a new window in the search view results in a crash, because the
new window does not have a view for the initial location. That can be
worked around by pointing the new window to the home directory.
https://bugzilla.gnome.org/show_bug.cgi?id=772856
Diffstat (limited to 'src/nautilus-application.c')
-rw-r--r-- | src/nautilus-application.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c index b33142f43..234fbb541 100644 --- a/src/nautilus-application.c +++ b/src/nautilus-application.c @@ -724,13 +724,24 @@ action_clone_window (GSimpleAction *action, NautilusWindowSlot *active_slot = NULL; NautilusWindow *active_window = NULL; GtkApplication *application = user_data; - g_autoptr (GFile) current_location = NULL; + g_autoptr (GFile) location = NULL; + NautilusView *current_view; active_window = NAUTILUS_WINDOW (gtk_application_get_active_window (application)); active_slot = nautilus_window_get_active_slot (active_window); - current_location = nautilus_window_slot_get_location (active_slot); + current_view = nautilus_window_slot_get_current_view (active_slot); - nautilus_application_open_location_full (NAUTILUS_APPLICATION (application), current_location, + if (current_view != NULL && + nautilus_view_is_searching (current_view)) + { + location = g_file_new_for_path (g_get_home_dir ()); + } + else + { + location = nautilus_window_slot_get_location (active_slot); + } + + nautilus_application_open_location_full (NAUTILUS_APPLICATION (application), location, NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW, NULL, NULL, NULL); } |