[nautilus/gtk3-breakage] application: properly handle --no-default-window



commit f2090110fcac62cd4e6160dcce526cd14597babd
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Oct 27 18:36:54 2010 +0200

    application: properly handle --no-default-window

 src/nautilus-application.c |   19 +++++++++++++++++++
 src/nautilus-main.c        |   19 -------------------
 2 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index f92bbd8..988af32 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1461,6 +1461,8 @@ nautilus_application_command_line (GApplication *app,
 	gboolean no_desktop = FALSE;
 	gboolean browser_window = FALSE;
 	gboolean kill_shell = FALSE;
+	gboolean autostart_mode = FALSE;
+	const gchar *autostart_id;
 	gchar *geometry = NULL;
 	gchar **remaining = NULL;
 	const GOptionEntry options[] = {
@@ -1556,6 +1558,19 @@ nautilus_application_command_line (GApplication *app,
 		goto out;
 	}
 
+	autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
+	if (autostart_id != NULL && *autostart_id != '\0') {
+		autostart_mode = TRUE;
+        }
+
+	/* If in autostart mode (aka started by gnome-session), we need to ensure 
+         * nautilus starts with the correct options.
+         */
+	if (autostart_mode) {
+		no_default_window = TRUE;
+		no_desktop = FALSE;
+	}
+
 	if (kill_shell) {
 		g_application_release (app);
 	} else {
@@ -1575,6 +1590,10 @@ nautilus_application_command_line (GApplication *app,
 			nautilus_application_open_desktop (self);
 		}
 
+		if (no_default_window && no_desktop) {
+			g_application_hold (app);
+		}
+
 		finish_startup (self, no_desktop);
 
 		/* Monitor the preference to show or hide the desktop */
diff --git a/src/nautilus-main.c b/src/nautilus-main.c
index ad169bf..a6da420 100644
--- a/src/nautilus-main.c
+++ b/src/nautilus-main.c
@@ -224,11 +224,7 @@ setup_debug_log (void)
 int
 main (int argc, char *argv[])
 {
-	gboolean no_default_window;
-	gboolean no_desktop;
-	gboolean autostart_mode;
 	gint retval;
-	const char *autostart_id;
 	NautilusApplication *application;
 	
 #if defined (HAVE_MALLOPT) && defined(M_MMAP_THRESHOLD)
@@ -260,21 +256,6 @@ main (int argc, char *argv[])
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
-	autostart_mode = FALSE;
-
-	autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
-	if (autostart_id != NULL && *autostart_id != '\0') {
-		autostart_mode = TRUE;
-        }
-
-	/* If in autostart mode (aka started by gnome-session), we need to ensure 
-         * nautilus starts with the correct options.
-         */
-	if (autostart_mode) {
-		no_default_window = TRUE;
-		no_desktop = FALSE;
-	}
-
 	g_set_prgname ("nautilus");
 
 	if (g_file_test (DATADIR "/applications/nautilus.desktop", G_FILE_TEST_EXISTS)) {



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