File 0001-application-add-force-desktop-action.patch of Package nautilus.520

From 05eefab35135dfbc5525a6cd5c279f943a962beb Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 11 Mar 2014 11:27:53 -0400
Subject: [PATCH] application: add force-desktop action

This commit adds a "force-desktop" action to explicitly force the
desktop in the case nautilus is already running when

nautilus --force-desktop

is executed.

https://bugzilla.gnome.org/show_bug.cgi?id=726114
---
 src/nautilus-application.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Index: nautilus-3.10.1/src/nautilus-application.c
===================================================================
--- nautilus-3.10.1.orig/src/nautilus-application.c
+++ nautilus-3.10.1/src/nautilus-application.c
@@ -87,6 +87,7 @@ static GList *nautilus_application_deskt
 static gboolean save_of_accel_map_requested = FALSE;
 
 static void     desktop_changed_callback          (gpointer                  user_data);
+static void     nautilus_application_open_desktop (NautilusApplication *application);
 
 G_DEFINE_TYPE (NautilusApplication, nautilus_application, GTK_TYPE_APPLICATION);
 
@@ -921,6 +922,16 @@ action_help (GSimpleAction *action,
 }
 
 static void
+action_force_desktop (GSimpleAction *action,
+		      GVariant *parameter,
+		      gpointer user_data)
+{
+	NautilusApplication *self = user_data;
+
+	nautilus_application_open_desktop (self);
+}
+
+static void
 action_kill (GSimpleAction *action,
 	     GVariant *parameter,
 	     gpointer user_data)
@@ -1005,6 +1016,7 @@ static GActionEntry app_entries[] = {
 	{ "help", action_help, NULL, NULL, NULL },
 	{ "quit", action_quit, NULL, NULL, NULL },
 	{ "kill", action_kill, NULL, NULL, NULL },
+	{ "force-desktop", action_force_desktop, NULL, NULL, NULL },
 };
 
 static void
@@ -1296,6 +1308,13 @@ nautilus_application_local_command_line
 		goto out;
 	}
 
+	if (self->priv->force_desktop) {
+		DEBUG ("Forcing desktop, as requested");
+		g_action_group_activate_action (G_ACTION_GROUP (application),
+						"force-desktop", NULL);
+                /* fall through */
+	}
+
 	GFile **files;
 	gint idx, len;