aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-session.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2010-05-04 18:05:00 +0800
committerXan Lopez <xan@gnome.org>2010-05-04 18:05:58 +0800
commit285aa46afc29e1e0e3a3e8979d01b46407decee2 (patch)
tree7ef8255d6832354ac8c79294d522c1009ef40c57 /src/ephy-session.c
parentcaa7494c963298c837cdca99f863f9c816b6cd33 (diff)
downloadgsoc2013-epiphany-285aa46afc29e1e0e3a3e8979d01b46407decee2.tar.gz
gsoc2013-epiphany-285aa46afc29e1e0e3a3e8979d01b46407decee2.tar.zst
gsoc2013-epiphany-285aa46afc29e1e0e3a3e8979d01b46407decee2.zip
ephy-session: fix thinko when restoring a multiple-window session
We were trying to reuse the first EphyEmbed in each window, but only the first one will actually have one. Refactor the code to only attempt this on the first window.
Diffstat (limited to 'src/ephy-session.c')
-rw-r--r--src/ephy-session.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index d7cf59928..9adf2dcfd 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -1433,9 +1433,9 @@ confirm_before_recover (EphyWindow* window, char* url, char* title)
static void
parse_embed (xmlNodePtr child,
EphyWindow *window,
+ gboolean is_first_window,
EphySession *session)
{
- gboolean loaded_first = FALSE;
EphySessionPrivate *priv = session->priv;
while (child != NULL)
@@ -1470,7 +1470,7 @@ parse_embed (xmlNodePtr child,
recover_url = (char *) url;
/* Reuse the window holding the recovery infobar instead of creating a new one */
- if (loaded_first == FALSE && priv->resume_window != NULL)
+ if (is_first_window == TRUE && priv->resume_window != NULL)
{
EphyWebView *web_view;
EphyEmbed *embed;
@@ -1478,6 +1478,8 @@ parse_embed (xmlNodePtr child,
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, recover_url);
+
+ is_first_window = FALSE;
}
else
{
@@ -1486,8 +1488,6 @@ parse_embed (xmlNodePtr child,
EPHY_NEW_TAB_OPEN_PAGE |
EPHY_NEW_TAB_APPEND_LAST);
}
-
- loaded_first = TRUE;
}
else if (was_loading && url != NULL &&
strcmp ((const char *) url, "about:blank") != 0)
@@ -1619,6 +1619,7 @@ ephy_session_load (EphySession *session,
if (xmlStrEqual (child->name, (const xmlChar *) "window"))
{
xmlChar *tmp;
+ EphyEmbed *active_child;
if (first_window_created == FALSE && priv->resume_window != NULL)
{
@@ -1634,7 +1635,8 @@ ephy_session_load (EphySession *session,
ephy_gui_window_update_user_time (widget, user_time);
/* Now add the tabs */
- parse_embed (child->children, window, session);
+ parse_embed (child->children, window,
+ window == EPHY_WINDOW (priv->resume_window), session);
/* Set focus to something sane */
tmp = xmlGetProp (child, (xmlChar *) "active-tab");
@@ -1653,8 +1655,8 @@ ephy_session_load (EphySession *session,
}
}
- gtk_widget_grab_focus (GTK_WIDGET (ephy_embed_container_get_active_child
- (EPHY_EMBED_CONTAINER (window))));
+ active_child = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
+ gtk_widget_grab_focus (GTK_WIDGET (active_child));
gtk_widget_show (widget);
}
else if (xmlStrEqual (child->name, (const xmlChar *) "toolwindow"))