[gtk/matthiasc/for-master] popovermenu: Fix keynav with submenus
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] popovermenu: Fix keynav with submenus
- Date: Sat, 28 Dec 2019 03:54:52 +0000 (UTC)
commit 9543a5daebe43da14d5a8dd710d500940ebe97d3
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 27 22:52:08 2019 -0500
popovermenu: Fix keynav with submenus
When we right-arrow all the way into a submenu
and then cycle to the next menu in a menubar,
we need to reset all open submenus, so that
left-arrowing back to the menu puts the focus
on the first item again.
gtk/gtkpopovermenu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index 62993b51e3..447d21171a 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -360,6 +360,7 @@ gtk_popover_menu_focus (GtkWidget *widget,
{
if (GTK_POPOVER_MENU (widget)->open_submenu)
{
+ g_print ("open submenu\n");
if (gtk_widget_child_focus (GTK_POPOVER_MENU (widget)->open_submenu, direction))
return TRUE;
if (direction == GTK_DIR_LEFT)
@@ -440,6 +441,14 @@ add_arrow_bindings (GtkBindingSet *binding_set,
GTK_TYPE_DIRECTION_TYPE, direction);
}
+static void
+gtk_popover_menu_show (GtkWidget *widget)
+{
+ gtk_popover_menu_set_open_submenu (GTK_POPOVER_MENU (widget), NULL);
+
+ GTK_WIDGET_CLASS (gtk_popover_menu_parent_class)->show (widget);
+}
+
static void
gtk_popover_menu_class_init (GtkPopoverMenuClass *klass)
{
@@ -454,6 +463,7 @@ gtk_popover_menu_class_init (GtkPopoverMenuClass *klass)
widget_class->map = gtk_popover_menu_map;
widget_class->unmap = gtk_popover_menu_unmap;
widget_class->focus = gtk_popover_menu_focus;
+ widget_class->show = gtk_popover_menu_show;
g_object_class_install_property (object_class,
PROP_VISIBLE_SUBMENU,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]