aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-main.c
diff options
context:
space:
mode:
authorMark McLoughlin <mark@skynet.ie>2003-10-17 17:52:06 +0800
committerMark McLoughlin <markmc@src.gnome.org>2003-10-17 17:52:06 +0800
commit7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25 (patch)
tree972086c50e90bc3fd85900f2a38015f27753ecf3 /src/ephy-main.c
parent36a5571d794ae7a8f6688bea86796975b4b145a8 (diff)
downloadgsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.tar
gsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.tar.gz
gsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.tar.bz2
gsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.tar.lz
gsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.tar.xz
gsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.tar.zst
gsoc2013-epiphany-7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25.zip
Change the behaviour of --nautilus-view such that the process doesn't exit
2003-10-16 Mark McLoughlin <mark@skynet.ie> Change the behaviour of --nautilus-view such that the process doesn't exit until the last control has been destroyed. The previous behaviour caused intermittent activation failure when the process timed out and died before the view could be created - bug #124768. * src/ephy-main.c: (ephy_main_start): don't unref the shell when started with --nautilus-view. (ephy_main_dummy_url_argument), (ephy_main_translate_url_arguments): create a dummy argument when no arguments are supplied which will cause the default window to be opened. * src/ephy-shell.c: (ephy_nautilus_view_all_controls_dead): unref the shell here causing the process to exit. (ephy_nautilus_view_init_factory): setup the all_controls_dead callback. (ephy_nautilus_view_new): instrument the control.
Diffstat (limited to 'src/ephy-main.c')
-rw-r--r--src/ephy-main.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 4cd79fc7e..6ca4209ed 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -215,20 +215,7 @@ ephy_main_start (gpointer data)
(gaserver, &corba_env);
}
/* provided with urls? */
- else if (n_urls == 0 &&
- !open_as_nautilus_view)
- {
- /* no, open a default window */
- GNOME_EphyAutomation_loadurl
- (gaserver, "",
- open_fullscreen,
- open_in_existing,
- open_in_new_window,
- open_in_new_tab,
- !noraise,
- &corba_env);
- }
- else
+ else if (!open_as_nautilus_view)
{
/* open all of the urls */
for (i = 0; i < n_urls; i++)
@@ -244,8 +231,11 @@ ephy_main_start (gpointer data)
}
}
- /* Unref so it will exit if no more used */
- if (first_instance)
+ /* Unref so it will exit if no more used
+ * If started with --nautilus-view, only exit when the
+ * last view has been destroyed.
+ */
+ if (first_instance && !open_as_nautilus_view)
{
g_object_unref (G_OBJECT(ephy_shell));
}
@@ -262,6 +252,18 @@ ephy_main_start (gpointer data)
return FALSE;
}
+/* dummy argument to open a default window */
+static gint
+ephy_main_dummy_url_argument (gchar ***urls)
+{
+ *urls = g_new0 (gchar *, 2);
+
+ (*urls)[0] = g_strdup ("");
+ (*urls)[1] = NULL;
+
+ return 1;
+}
+
/**
* translate_url_arguments: gather URL arguments and expand them fully
* with realpath if they're filenames
@@ -276,8 +278,7 @@ ephy_main_translate_url_arguments (poptContext context, gchar ***urls)
/* any context remaining? */
if (context == NULL)
{
- *urls = NULL;
- return 0;
+ return ephy_main_dummy_url_argument (urls);
}
/* get the args and check */
@@ -285,8 +286,7 @@ ephy_main_translate_url_arguments (poptContext context, gchar ***urls)
if (args == NULL)
{
poptFreeContext (context);
- *urls = NULL;
- return 0;
+ return ephy_main_dummy_url_argument (urls);
}
/* count args */