[gtk+] bindings: Convert to use GdkEvent API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] bindings: Convert to use GdkEvent API
- Date: Tue, 19 Sep 2017 17:15:14 +0000 (UTC)
commit 01b993d1fb02bfb0fca5d67666102b4a8d7753c9
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Aug 25 22:51:18 2017 -0400
bindings: Convert to use GdkEvent API
gtk/gtkbindings.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c
index 165f82b..1bf47b7 100644
--- a/gtk/gtkbindings.c
+++ b/gtk/gtkbindings.c
@@ -1580,6 +1580,9 @@ gtk_bindings_activate_event (GObject *object,
GdkDisplay *display;
GtkKeyHash *key_hash;
gboolean handled = FALSE;
+ guint16 keycode;
+ GdkModifierType state;
+ guint group;
if (!GTK_IS_WIDGET (object))
return FALSE;
@@ -1587,11 +1590,15 @@ gtk_bindings_activate_event (GObject *object,
display = gtk_widget_get_display (GTK_WIDGET (object));
key_hash = binding_key_hash_for_keymap (gdk_keymap_get_for_display (display));
+ gdk_event_get_keycode ((GdkEvent *)event, &keycode);
+ gdk_event_get_state ((GdkEvent *)event, &state);
+ gdk_event_get_key_group ((GdkEvent *)event, &group);
+
entries = _gtk_key_hash_lookup (key_hash,
- event->hardware_keycode,
- event->state,
+ keycode,
+ state,
BINDING_MOD_MASK () & ~GDK_RELEASE_MASK,
- event->group);
+ group);
handled = gtk_bindings_activate_list (object, entries,
gdk_event_get_event_type ((GdkEvent *) event) == GDK_KEY_RELEASE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]