diff --git a/ChangeLog b/ChangeLog index 6427e90c33bb101ee40438bf9fbab573bde1b166..800a8e115b5850d3a7d368d5a08194bdf0e7af16 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 ef7d18da142affc9aff0041cff7a2b8ea7b103f4..523b1891cc0003dff15678c17fe4db327d42e9f7 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 11ed66febb687823b913f7fd5ceb7e9c7a405f4c..5c8e3e83dd3c71e422d330ed8c519865e6a453c0 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 */