[gtk/wip/matthiasc/context-menu: 24/30] popover menu: Add our own activate key bindings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/context-menu: 24/30] popover menu: Add our own activate key bindings
- Date: Thu, 13 Jun 2019 00:26:14 +0000 (UTC)
commit 40017aab12631f2b8b433f56b8292b6b8a8e5748
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jun 12 16:55:43 2019 +0000
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.
gtk/gtkpopovermenu.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index 5b3fa927a1..93a0ba8953 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -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);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]