Commit faffb0b6 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

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
parent 86e47f46
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
......
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment