summaryrefslogtreecommitdiff
path: root/src/nautilus-main.c
diff options
context:
space:
mode:
authorChristian Neumair <cneumair@gnome.org>2008-08-31 10:13:45 +0000
committerChristian Neumair <cneumair@src.gnome.org>2008-08-31 10:13:45 +0000
commitfaffb0b644f184c9fa4771000e1878d879f91edc (patch)
tree7583fb37c7624e368386217bb05d355ae4a0e2d2 /src/nautilus-main.c
parent86e47f46c6306fa45061c8f68341860a1eedde65 (diff)
downloadnautilus-faffb0b644f184c9fa4771000e1878d879f91edc.tar.gz
Detect restart requests by the session manager (i.e. after crashes), only
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. svn path=/trunk/; revision=14546
Diffstat (limited to 'src/nautilus-main.c')
-rw-r--r--src/nautilus-main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nautilus-main.c b/src/nautilus-main.c
index 4ffe48f7a..c78fa648b 100644
--- a/src/nautilus-main.c
+++ b/src/nautilus-main.c
@@ -371,11 +371,13 @@ main (int argc, char *argv[])
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 @@ main (int argc, char *argv[])
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 @@ main (int argc, char *argv[])
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 */