From a11996b8b901848866428f5210cab40787b33321 Mon Sep 17 00:00:00 2001 From: Christian Neumair Date: Mon, 21 Apr 2008 20:57:47 +0000 Subject: [PATCH] Support new gnome-session autostart semantics (#525056). Thanks to Lucas 2008-04-21 Christian Neumair * nautilus.desktop.in.in: * src/nautilus-main.c (main): Support new gnome-session autostart semantics (#525056). Thanks to Lucas Rocha. svn path=/trunk/; revision=14077 --- ChangeLog | 7 +++++++ nautilus.desktop.in.in | 3 +++ src/nautilus-main.c | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6427e90c3..800a8e115 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-21 Christian Neumair + + * nautilus.desktop.in.in: + * src/nautilus-main.c (main): + Support new gnome-session autostart semantics (#525056). Thanks to + Lucas Rocha. + 2008-04-15 Cosimo Cecchi * libnautilus-private/nautilus-file.c: (compare_by_time): diff --git a/nautilus.desktop.in.in b/nautilus.desktop.in.in index ef7d18da1..523b1891c 100644 --- a/nautilus.desktop.in.in +++ b/nautilus.desktop.in.in @@ -14,3 +14,6 @@ X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=nautilus X-GNOME-Bugzilla-Component=general X-GNOME-Bugzilla-Version=@VERSION@ +X-GNOME-Autostart-Phase=Desktop +X-GNOME-Provides=desktop +X-GNOME-Autostart-Notify=true diff --git a/src/nautilus-main.c b/src/nautilus-main.c index 11ed66feb..5c8e3e83d 100644 --- a/src/nautilus-main.c +++ b/src/nautilus-main.c @@ -373,7 +373,8 @@ main (int argc, char *argv[]) gboolean no_default_window; gboolean browser_window; gboolean no_desktop; - const char *startup_id; + gboolean autostart_mode; + const char *startup_id, *autostart_id; char *startup_id_copy; char *session_to_load; gchar *geometry; @@ -433,6 +434,11 @@ main (int argc, char *argv[]) g_unsetenv ("DESKTOP_STARTUP_ID"); } + autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); + if (autostart_id != NULL && *autostart_id != '\0') { + autostart_mode = TRUE; + } + /* we'll do it ourselves due to complicated factory setup */ gtk_window_set_auto_startup_notification (FALSE); @@ -473,6 +479,14 @@ main (int argc, char *argv[]) no_default_window = 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; + } + /* Do this here so that gdk_display is initialized */ if (startup_id_copy == NULL) { /* Create a fake one containing a timestamp that we can use */ -- GitLab