aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index a3cae94cf..fafce396e 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -805,6 +805,15 @@ close_button_clicked_cb (GtkWidget *widget, GtkWidget *tab)
if (inhibited == FALSE)
{
+ GtkNotebook *gnotebook;
+ GtkWidget *active_tab;
+
+ gnotebook = GTK_NOTEBOOK (notebook);
+ active_tab = gtk_notebook_get_nth_page
+ (gnotebook, gtk_notebook_get_current_page (gnotebook));
+ /* focus the active tab, bug #119461 */
+ gtk_widget_grab_focus (active_tab);
+
ephy_notebook_remove_tab (notebook, EPHY_TAB (tab));
}
}
@@ -858,6 +867,9 @@ build_tab_label (EphyNotebook *nb, EphyTab *tab)
close_button = gtk_button_new ();
gtk_button_set_relief (GTK_BUTTON (close_button),
GTK_RELIEF_NONE);
+ /* don't allow focus on the close button */
+ GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_FOCUS);
+ GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
close_icon_size = gtk_icon_size_from_name (EPHY_ICON_SIZE_TAB_BUTTON);
image = gtk_image_new_from_stock (EPHY_STOCK_CLOSE_TAB, close_icon_size);
gtk_container_add (GTK_CONTAINER (close_button), image);