diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/nautilus-main.c | 15 |
2 files changed, 21 insertions, 0 deletions
@@ -1,5 +1,11 @@ 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. + +2008-08-31 Christian Neumair <cneumair@gnome.org> + * src/file-manager/fm-directory-view.c (get_file_names_as_parameter_array), (run_script_callback): Get script file name as script parameter relative to current 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 */ |