aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2012-12-11 01:13:27 +0800
committerGustavo Noronha Silva <gns@gnome.org>2012-12-11 20:34:37 +0800
commitb7f88ee85c61fee4f8059e7fc2456c3ca83ccb64 (patch)
treef1047567ac13933d429f948cb18509fa543849f7 /src
parentc968c68cabc319896ad4d2096940c9a34d4c13cd (diff)
downloadgsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.tar
gsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.tar.gz
gsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.tar.bz2
gsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.tar.lz
gsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.tar.xz
gsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.tar.zst
gsoc2013-epiphany-b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64.zip
Open new windows when called with no URIs to open
GNOME Shell tries to open new windows by calling the application with no parameters. This strategy is also used by the 'Launch web browser' keybinding, that can be interpreted as the user requesting a new window, so open a new window when called with no URIs, unless --new-tag is given explicitly. Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=685976
Diffstat (limited to 'src')
-rw-r--r--src/ephy-session.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 3a0f197a3..044b75414 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -256,6 +256,7 @@ session_command_open_uris (EphySession *session,
EphyNewTabFlags flags = 0;
guint i;
gboolean new_windows_in_tabs;
+ gboolean have_uris;
shell = ephy_shell_get_default ();
@@ -266,6 +267,8 @@ session_command_open_uris (EphySession *session,
new_windows_in_tabs = g_settings_get_boolean (EPHY_SETTINGS_MAIN,
EPHY_PREFS_NEW_WINDOWS_IN_TABS);
+ have_uris = ! (g_strv_length (uris) == 1 && g_str_equal (uris[0], ""));
+
if (options != NULL && strstr (options, "external") != NULL)
{
flags |= EPHY_NEW_TAB_FROM_EXTERNAL;
@@ -276,12 +279,17 @@ session_command_open_uris (EphySession *session,
flags |= EPHY_NEW_TAB_IN_NEW_WINDOW;
}
else if ((options != NULL && strstr (options, "new-tab") != NULL) ||
- new_windows_in_tabs)
+ (new_windows_in_tabs && have_uris))
{
flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW |
EPHY_NEW_TAB_JUMP |
EPHY_NEW_TAB_PRESENT_WINDOW;
}
+ else if (!have_uris)
+ {
+ window = NULL;
+ flags |= EPHY_NEW_TAB_IN_NEW_WINDOW;
+ }
for (i = 0; uris[i] != NULL; ++i)
{