From b7f88ee85c61fee4f8059e7fc2456c3ca83ccb64 Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Mon, 10 Dec 2012 18:13:27 +0100 Subject: 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 --- src/ephy-session.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3