nautilus r14546 - in trunk: . src



Author: cneumair
Date: Sun Aug 31 10:13:45 2008
New Revision: 14546
URL: http://svn.gnome.org/viewvc/nautilus?rev=14546&view=rev

Log:
2008-08-31  Christian Neumair  <cneumair gnome org>

	* src/nautilus-main.c (main):
	Detect restart requests by the session manager (i.e. after crashes),
	only show default window if no desktop window is shown. Fixes #99221.


Modified:
   trunk/ChangeLog
   trunk/src/nautilus-main.c

Modified: trunk/src/nautilus-main.c
==============================================================================
--- trunk/src/nautilus-main.c	(original)
+++ trunk/src/nautilus-main.c	Sun Aug 31 10:13:45 2008
@@ -371,11 +371,13 @@
 	gboolean browser_window;
 	gboolean no_desktop;
 	gboolean autostart_mode;
+	gboolean has_sm_argv;
 	const char *startup_id, *autostart_id;
 	char *startup_id_copy;
 	char *session_to_load;
 	gchar *geometry;
 	const gchar **remaining;
+	char **p;
 	gboolean perform_self_check;
 	GOptionContext *context;
 	NautilusApplication *application;
@@ -438,6 +440,14 @@
 		autostart_mode = TRUE;
         }
 
+	/* detect whether this is a restart request by the SM */
+	has_sm_argv = FALSE;
+	for (p = argv; p - argv < argc; p++) {
+		if (g_str_has_prefix (*p, "--sm-client-id")) {
+			has_sm_argv = TRUE;
+		}
+	}
+
 	/* we'll do it ourselves due to complicated factory setup */
 	gtk_window_set_auto_startup_notification (FALSE);
 
@@ -543,6 +553,11 @@
 		eel_preferences_set_is_invisible
 			(NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR, TRUE);
 	}
+
+	if (has_sm_argv && eel_preferences_get_boolean (NAUTILUS_PREFERENCES_SHOW_DESKTOP)) {
+		/* we were restarted by the session manager. Don't show default window */
+		no_default_window = TRUE;
+	}
 	
 	bonobo_activate (); /* do now since we need it before main loop */
 



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