popover menu: Add our own activate key bindings

This solves issues with parent widgets, like combobox
or entry, installing their own bindings for these
keys, overriding the activation behavior that
is implemented in gtkwindow.
This commit is contained in:
Matthias Clasen 2019-06-12 16:55:43 +00:00
parent d0a38c677c
commit c16f10abea

View File

@ -381,6 +381,17 @@ gtk_popover_menu_class_init (GtkPopoverMenuClass *klass)
add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
add_tab_bindings (binding_set, GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0,
"activate-default", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0,
"activate-default", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0,
"activate-default", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0,
"activate-default", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0,
"activate-default", 0);
}
/**