summaryrefslogtreecommitdiff
path: root/gtk/gtk_scaffolding.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-04-22 12:32:55 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-04-22 12:32:55 +0000
commitb815973c1518f2963d928500dc2b569fe24325df (patch)
tree8ac27f78c04f5e82388e46b5f77646268ce7fe10 /gtk/gtk_scaffolding.c
parent00fe40c14d4dad95bc1b7614f85a9285550a0436 (diff)
downloadnetsurf-b815973c1518f2963d928500dc2b569fe24325df.tar.gz
netsurf-b815973c1518f2963d928500dc2b569fe24325df.tar.bz2
Simplify handling of tab switching. Now only has one event entry point, rather than two (and is thus less confusing).
Update window titlebar on tab switch (based on r7234) svn path=/trunk/netsurf/; revision=7235
Diffstat (limited to 'gtk/gtk_scaffolding.c')
-rw-r--r--gtk/gtk_scaffolding.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c
index a11baee24..685495ff4 100644
--- a/gtk/gtk_scaffolding.c
+++ b/gtk/gtk_scaffolding.c
@@ -319,7 +319,7 @@ void nsgtk_window_update_back_forward(struct gtk_scaffolding *g)
history_forward_available(bw->history));
/* update the url bar, particularly necessary when tabbing */
- if ((bw->current_content) && bw->current_content->url)
+ if (bw->current_content != NULL && bw->current_content->url != NULL)
browser_window_refresh_url_bar(bw, bw->current_content->url,
bw->frag_id);
@@ -327,8 +327,8 @@ void nsgtk_window_update_back_forward(struct gtk_scaffolding *g)
* for it.
*/
history_size(bw->history, &width, &height);
- gtk_widget_set_size_request(GTK_WIDGET(g->history_window->drawing_area)
- , width, height);
+ gtk_widget_set_size_request(GTK_WIDGET(g->history_window->drawing_area),
+ width, height);
gtk_widget_queue_draw(GTK_WIDGET(g->history_window->drawing_area));
}
@@ -1385,8 +1385,6 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
CONNECT(g->history_window->window, "delete_event",
gtk_widget_hide_on_delete, NULL);
- g_signal_connect_swapped(g->notebook, "switch-page",
- G_CALLBACK(nsgtk_window_update_back_forward), g);
g_signal_connect_after(g->notebook, "page-added",
G_CALLBACK(nsgtk_window_tabs_num_changed), g);
g_signal_connect_after(g->notebook, "page-removed",
@@ -1568,6 +1566,19 @@ GtkNotebook* nsgtk_scaffolding_get_notebook (struct gui_window *g)
void nsgtk_scaffolding_set_top_level (struct gui_window *gw)
{
gw->scaffold->top_level = gw;
+
+ /* Synchronise the history (will also update the URL bar) */
+ nsgtk_window_update_back_forward(gw->scaffold);
+
+ /* Ensure the window's title bar is updated */
+ if (gw->bw != NULL && gw->bw->current_content != NULL) {
+ if (gw->bw->current_content->title != NULL) {
+ gui_window_set_title(gw,
+ gw->bw->current_content->title);
+ } else {
+ gui_window_set_title(gw, gw->bw->current_content->url);
+ }
+ }
}
void nsgtk_scaffolding_popup_menu(struct gtk_scaffolding *g,