aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2011-03-12 11:08:51 +0800
committerGustavo Noronha Silva <gns@gnome.org>2011-03-12 22:16:13 +0800
commit05df86164b7aa8286cf8353355378145cf64b656 (patch)
treeb89cda00db3e470e9b8b34e1390bd5500839dc4b
parent9801a1a369481e69e360ffa76b3521daa8370b88 (diff)
downloadgsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.tar
gsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.tar.gz
gsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.tar.bz2
gsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.tar.lz
gsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.tar.xz
gsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.tar.zst
gsoc2013-epiphany-05df86164b7aa8286cf8353355378145cf64b656.zip
Open requested URI in new tab when a crashed session exists
When you ask Epiphany to load a new URI but a crashed session exists, the session was being completely discarded in favour of the new URI. This change causes the URI to be loaded in a new tab in the background while still presenting the user with the option to recover the session. Bug #625116
-rw-r--r--src/ephy-session.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 183ef2d92..995849f1e 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -544,7 +544,7 @@ session_command_autoresume (EphySession *session,
ephy_session_queue_command (session,
EPHY_SESSION_CMD_MAYBE_OPEN_WINDOW_RESTORE,
- NULL, NULL, user_time, FALSE);
+ NULL, NULL, user_time, TRUE);
}
static void
@@ -612,14 +612,29 @@ session_command_open_uris (EphySession *session,
/* For the first URI, if we have a valid recovery
* window, reuse the already existing embed instead of
- * creating a new one */
+ * creating a new one, except if we still want to
+ * present the option to resume a crashed session, in
+ * that case use a new tab in the same window */
if (i == 0 && priv->resume_window != NULL)
{
- EphyWebView *web_view;
-
- embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (priv->resume_window));
- web_view = ephy_embed_get_web_view (embed);
- ephy_web_view_load_url (web_view, url);
+ if (priv->resume_infobar != NULL)
+ {
+ embed = ephy_shell_new_tab_full (shell, priv->resume_window,
+ NULL /* parent tab */,
+ request,
+ EPHY_NEW_TAB_IN_EXISTING_WINDOW | page_flags,
+ EPHY_WEB_VIEW_CHROME_ALL,
+ FALSE /* is popup? */,
+ user_time);
+ }
+ else
+ {
+ EphyWebView *web_view;
+
+ embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (priv->resume_window));
+ web_view = ephy_embed_get_web_view (embed);
+ ephy_web_view_load_url (web_view, url);
+ }
}
else
{
@@ -795,8 +810,7 @@ session_command_dispatch (EphySession *session)
}
/* Look if there's anything else to dispatch */
- if (g_queue_is_empty (priv->queue) ||
- priv->resume_window != NULL)
+ if (g_queue_is_empty (priv->queue))
{
priv->queue_idle_id = 0;
run_again = FALSE;