--- xfce4-session-4.4.2/xfce4-session-logout/main.c.org 2008-08-22 13:28:59.000000000 -0700 +++ xfce4-session-4.4.2/xfce4-session-logout/main.c 2008-08-22 13:27:55.000000000 -0700 @@ -84,8 +84,7 @@ { SessionClient *client; gboolean managed; - - gtk_init (&argc, &argv); + pid_t pid; for (++argv; --argc > 0; ++argv) { @@ -106,6 +105,21 @@ } } + /* + * Sync all discs. Doing this before we even start will remove sync + * time later on in the shutdown phase and will overall make shutdown + * a faster user experience. If the user cancels or logs out, a sync + * call is not a bad hit to take anyway. + */ + pid = fork(); + if (pid == 0) + { + sync(); + exit(0); + } + + gtk_init (&argc, &argv); + client = client_session_new (argc, argv, NULL, SESSION_RESTART_NEVER, 99); client->die = die_handler; managed = session_init (client);