diff options
author | Michael Catanzaro <mcatanzaro@igalia.com> | 2015-03-07 14:57:31 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2015-08-31 10:31:11 -0500 |
commit | 4ca650b788b2ef34813722f73bb85e3491580a7a (patch) | |
tree | 239dd7b21633b114066312fb6dfaf4bfd6a19246 | |
parent | 248cb650f2b192210e7d2eaf66b0e12cda929e3a (diff) | |
download | epiphany-4ca650b788b2ef34813722f73bb85e3491580a7a.tar.gz |
Do not open an extra overview when starting the browser
If there is no saved session and the user launches Epiphany by clicking
a URI in another application, then we should open only one tab with that
URI. Currently we may open the overview and then the URI in a second tab,
because we do not consider the page to be blank if it is still loading.
Replace this tricky code. If the page is still loading it's not safe to
assume the URI has been set to whatever page was last loaded in it, and we
can't risk losing tabs from a previous session.
https://bugzilla.gnome.org/show_bug.cgi?id=745792
-rw-r--r-- | src/ephy-shell.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 3f1ad729d..1a093de8a 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -950,15 +950,6 @@ ephy_shell_close_all_windows (EphyShell *shell) return retval; } -static gboolean -tab_is_empty (EphyEmbed *embed) -{ - EphyWebView *view = ephy_embed_get_web_view (embed); - - return ((ephy_web_view_get_is_blank (view) || ephy_web_view_is_overview (view)) && - !ephy_web_view_is_loading (view)); -} - typedef struct { EphyShell *shell; EphySession *session; @@ -1035,7 +1026,9 @@ ephy_shell_open_uris_idle (OpenURIsData *data) page_flags |= EPHY_NEW_TAB_APPEND_AFTER; else if (data->reuse_empty_tab) { embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (data->window)); - reusing_empty_tab = tab_is_empty (embed); + /* Only load a new page in this embed if it was showing or loading the homepage about:overview */ + if (ephy_web_view_get_visit_type (ephy_embed_get_web_view (embed)) == EPHY_PAGE_VISIT_HOMEPAGE) + reusing_empty_tab = TRUE; } if (!reusing_empty_tab) { |