From 21431662e7680e81ba99b28acf8653a13526872c Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Jun 25 2017 17:55:49 +0000 Subject: Fix control-n (new window) action call back when used from the desktop proces --- diff --git a/fix_new_window_crash.patch b/fix_new_window_crash.patch new file mode 100644 index 0000000..dd30be4 --- /dev/null +++ b/fix_new_window_crash.patch @@ -0,0 +1,76 @@ +From 2f9ccae6f917924954b178750ee0c8d216cd7cf6 Mon Sep 17 00:00:00 2001 +From: Michael Webster +Date: Sun, 25 Jun 2017 13:48:08 -0400 +Subject: [PATCH] nemo-window-menus.c: Fix control-n (new window) action + callback when used from the desktop process - it should launch the preferred + file manager instead of attempting to spawn a window itself. + +Fixes #1532 +--- + src/nemo-window-menus.c | 47 +++++++++++++++++++++++++++++++++-------------- + 1 file changed, 33 insertions(+), 14 deletions(-) + +diff --git a/src/nemo-window-menus.c b/src/nemo-window-menus.c +index 41134d1e0..e89c7aff4 100644 +--- a/src/nemo-window-menus.c ++++ b/src/nemo-window-menus.c +@@ -752,26 +752,45 @@ nemo_window_initialize_go_menu (NemoWindow *window) + + static void + action_new_window_callback (GtkAction *action, +- gpointer user_data) ++ gpointer user_data) + { +- NemoApplication *application; +- NemoWindow *current_window, *new_window; +- gchar *uri; ++ NemoWindow *current_window; + +- current_window = NEMO_WINDOW (user_data); ++ current_window = NEMO_WINDOW (user_data); + +- uri = nemo_window_slot_get_current_uri (nemo_window_get_active_slot (current_window)); +- GFile *loc = g_file_new_for_uri (uri); ++ if (NEMO_IS_DESKTOP_WINDOW (current_window)) { ++ NemoFile *file; ++ NemoView *view; ++ gchar *desktop_uri; + +- application = nemo_application_get_singleton (); ++ desktop_uri = nemo_get_desktop_directory_uri (); + +- new_window = nemo_application_create_window ( +- application, +- gtk_window_get_screen (GTK_WINDOW (current_window))); ++ file = nemo_file_get_existing_by_uri (desktop_uri); + +- nemo_window_slot_open_location (nemo_window_get_active_slot (new_window), loc, 0); +- g_object_unref (loc); +- g_free (uri); ++ view = nemo_window_slot_get_current_view (nemo_window_get_active_slot (current_window)); ++ nemo_view_activate_file (view, file, 0); ++ ++ g_free (desktop_uri); ++ nemo_file_unref (file); ++ } else { ++ NemoApplication *application; ++ NemoWindow *new_window; ++ gchar *uri; ++ GFile *loc; ++ ++ uri = nemo_window_slot_get_current_uri (nemo_window_get_active_slot (current_window)); ++ loc = g_file_new_for_uri (uri); ++ ++ application = nemo_application_get_singleton (); ++ ++ new_window = nemo_application_create_window (application, ++ gtk_window_get_screen (GTK_WINDOW (current_window))); ++ ++ nemo_window_slot_open_location (nemo_window_get_active_slot (new_window), loc, 0); ++ ++ g_object_unref (loc); ++ g_free (uri); ++ } + } + + static void diff --git a/nemo.spec b/nemo.spec index 5670d85..b637c42 100644 --- a/nemo.spec +++ b/nemo.spec @@ -1,7 +1,7 @@ Name: nemo Summary: File manager for Cinnamon Version: 3.4.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/linuxmint/ Source0: %url/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -9,6 +9,7 @@ Source1: https://raw.githubusercontent.com/linuxmint/mint-common/master/u Source2: nemo-fedora.gschema.override Patch0: remove_desktop_search.patch Patch1: %url/%{name}/pull/1513.patch#/Don-t-scale-text-size-when-zooming.patch +Patch2: %url/%{name}/commit/2f9ccae6f917924954b178750ee0c8d216cd7cf6.patch#/fix_new_window_crash.patch Requires: redhat-menus Requires: gvfs%{_isa} @@ -144,6 +145,10 @@ fi %{_datadir}/gir-1.0/*.gir %changelog +* Sun Jun 25 2017 Leigh Scott - 3.4.4-2 +- Fix control-n (new window) action callback when used from + the desktop process + * Thu Jun 22 2017 Leigh Scott - 3.4.4-1 - update to 3.4.4 release - Remove build requires rarian-compat