Skip to content

Commit 1c99684

Browse files
committed
menus: when activating File->New Window in a search results view,
open a new window using the original uri instead of the virtual search results location. Fixes: #2941
1 parent 03666d7 commit 1c99684

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/nemo-window-menus.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,24 @@ action_new_window_callback (GtkAction *action,
833833
GFile *loc;
834834

835835
uri = nemo_window_slot_get_current_uri (nemo_window_get_active_slot (current_window));
836+
837+
if (eel_uri_is_search (uri)) {
838+
NemoDirectory *dir;
839+
NemoQuery *query;
840+
841+
dir = nemo_directory_get_by_uri (uri);
842+
query = nemo_search_directory_get_query (NEMO_SEARCH_DIRECTORY (dir));
843+
844+
if (query != NULL) {
845+
g_free (uri);
846+
847+
uri = nemo_query_get_location (query);
848+
g_object_unref (query);
849+
}
850+
851+
nemo_directory_unref (dir);
852+
}
853+
836854
loc = g_file_new_for_uri (uri);
837855

838856
application = nemo_application_get_singleton ();

0 commit comments

Comments
 (0)