diff options
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r-- | src/ephy-notebook.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index fb0e6aeaa..3526e4205 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -1162,3 +1162,24 @@ ephy_notebook_tab_is_pinned (EphyNotebook *notebook, return ephy_tab_label_is_pinned (tab_label); } + +void +ephy_notebook_switch_to_last_tab (EphyNotebook *notebook) +{ + GList *l; + GtkWidget *child; + int page_num; + + if (!notebook->focused_pages) + return; + + l = g_list_last (notebook->focused_pages); + if (!l->prev) + return; + + child = GTK_WIDGET (l->prev->data); + page_num = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), + child); + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), + page_num); +} |