Commit 8d9d6128 authored by Cosimo Cecchi's avatar Cosimo Cecchi

application: properly handle --no-default-window

parent 13630f0b
...@@ -1461,6 +1461,8 @@ nautilus_application_command_line (GApplication *app, ...@@ -1461,6 +1461,8 @@ nautilus_application_command_line (GApplication *app,
gboolean no_desktop = FALSE; gboolean no_desktop = FALSE;
gboolean browser_window = FALSE; gboolean browser_window = FALSE;
gboolean kill_shell = FALSE; gboolean kill_shell = FALSE;
gboolean autostart_mode = FALSE;
const gchar *autostart_id;
gchar *geometry = NULL; gchar *geometry = NULL;
gchar **remaining = NULL; gchar **remaining = NULL;
const GOptionEntry options[] = { const GOptionEntry options[] = {
...@@ -1556,6 +1558,19 @@ nautilus_application_command_line (GApplication *app, ...@@ -1556,6 +1558,19 @@ nautilus_application_command_line (GApplication *app,
goto out; goto out;
} }
autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
if (autostart_id != NULL && *autostart_id != '\0') {
autostart_mode = 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;
}
if (kill_shell) { if (kill_shell) {
g_application_release (app); g_application_release (app);
} else { } else {
...@@ -1575,6 +1590,10 @@ nautilus_application_command_line (GApplication *app, ...@@ -1575,6 +1590,10 @@ nautilus_application_command_line (GApplication *app,
nautilus_application_open_desktop (self); nautilus_application_open_desktop (self);
} }
if (no_default_window && no_desktop) {
g_application_hold (app);
}
finish_startup (self, no_desktop); finish_startup (self, no_desktop);
/* Monitor the preference to show or hide the desktop */ /* Monitor the preference to show or hide the desktop */
......
...@@ -224,11 +224,7 @@ setup_debug_log (void) ...@@ -224,11 +224,7 @@ setup_debug_log (void)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
gboolean no_default_window;
gboolean no_desktop;
gboolean autostart_mode;
gint retval; gint retval;
const char *autostart_id;
NautilusApplication *application; NautilusApplication *application;
#if defined (HAVE_MALLOPT) && defined(M_MMAP_THRESHOLD) #if defined (HAVE_MALLOPT) && defined(M_MMAP_THRESHOLD)
...@@ -260,21 +256,6 @@ main (int argc, char *argv[]) ...@@ -260,21 +256,6 @@ main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE); textdomain (GETTEXT_PACKAGE);
autostart_mode = FALSE;
autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
if (autostart_id != NULL && *autostart_id != '\0') {
autostart_mode = 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;
}
g_set_prgname ("nautilus"); g_set_prgname ("nautilus");
if (g_file_test (DATADIR "/applications/nautilus.desktop", G_FILE_TEST_EXISTS)) { if (g_file_test (DATADIR "/applications/nautilus.desktop", G_FILE_TEST_EXISTS)) {
......
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