diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 244fedcd7a..2ef0500171 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -776,6 +776,7 @@ gtk_popover_key_pressed (GtkWidget *widget, GdkModifierType state) { GtkPopover *popover = GTK_POPOVER (widget); + GtkWindow *root; if (keyval == GDK_KEY_Escape) { @@ -783,6 +784,8 @@ gtk_popover_key_pressed (GtkWidget *widget, return TRUE; } + root = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (popover))); + _gtk_window_update_focus_visible (root, keyval, state, TRUE); update_mnemonics_visible (popover, keyval, state, TRUE); return FALSE; @@ -795,7 +798,10 @@ gtk_popover_key_released (GtkWidget *widget, GdkModifierType state) { GtkPopover *popover = GTK_POPOVER (widget); + GtkWindow *root; + root = GTK_WINDOW (gtk_widget_get_root (GTK_WIDGET (popover))); + _gtk_window_update_focus_visible (root, keyval, state, FALSE); update_mnemonics_visible (popover, keyval, state, FALSE); return FALSE; diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 3fbfda95ee..36abbd3d2f 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4895,11 +4895,11 @@ update_mnemonics_visible (GtkWindow *window, } } -static void -update_focus_visible (GtkWindow *window, - guint keyval, - GdkModifierType state, - gboolean visible) +void +_gtk_window_update_focus_visible (GtkWindow *window, + guint keyval, + GdkModifierType state, + gboolean visible) { GtkWindowPrivate *priv = gtk_window_get_instance_private (window); @@ -4934,7 +4934,7 @@ gtk_window_key_pressed (GtkWidget *widget, { GtkWindow *window = GTK_WINDOW (widget); - update_focus_visible (window, keyval, state, TRUE); + _gtk_window_update_focus_visible (window, keyval, state, TRUE); update_mnemonics_visible (window, keyval, state, TRUE); return FALSE; @@ -4949,7 +4949,7 @@ gtk_window_key_released (GtkWidget *widget, { GtkWindow *window = GTK_WINDOW (widget); - update_focus_visible (window, keyval, state, FALSE); + _gtk_window_update_focus_visible (window, keyval, state, FALSE); update_mnemonics_visible (window, keyval, state, FALSE); return FALSE; diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h index 3679691759..a177f50310 100644 --- a/gtk/gtkwindowprivate.h +++ b/gtk/gtkwindowprivate.h @@ -34,6 +34,11 @@ void _gtk_window_group_remove_grab (GtkWindowGroup *window_group, void _gtk_window_unset_focus_and_default (GtkWindow *window, GtkWidget *widget); +void _gtk_window_update_focus_visible (GtkWindow *window, + guint keyval, + GdkModifierType state, + gboolean visible); + void _gtk_window_set_allocation (GtkWindow *window, int width, int height,