[gtk+/wip/matthiasc/emoji-picker: 756/756] fixup! wip: emoji completions



commit 6263f7b3d8a0ff4147d624f9679e1f0e9455a965
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 18 18:25:05 2017 +0200

    fixup! wip: emoji completions
    
    Fixes for GdkEvent API changes

 gtk/gtkemojicompletion.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkemojicompletion.c b/gtk/gtkemojicompletion.c
index e0036b2..a5b9dcf 100644
--- a/gtk/gtkemojicompletion.c
+++ b/gtk/gtkemojicompletion.c
@@ -181,30 +181,35 @@ entry_key_press (GtkEntry           *entry,
                  GdkEventKey        *event,
                  GtkEmojiCompletion *completion)
 {
+  guint keyval;
+
   if (!gtk_widget_get_visible (GTK_WIDGET (completion)))
     return FALSE;
 
-  if (event->keyval == GDK_KEY_Escape)
+  if (!gdk_event_get_keyval ((GdkEvent*)event, &keyval))
+    return FALSE;
+
+  if (keyval == GDK_KEY_Escape)
     {
       gtk_popover_popdown (GTK_POPOVER (completion));
       return TRUE;
     }
 
-  if (event->keyval == GDK_KEY_Up)
+  if (keyval == GDK_KEY_Up)
     {
       move_active_row (completion, -1);
       return TRUE;
     }
 
-  if (event->keyval == GDK_KEY_Down)
+  if (keyval == GDK_KEY_Down)
     {
       move_active_row (completion, 1);
       return TRUE;
     }
 
-  if (event->keyval == GDK_KEY_Return ||
-      event->keyval == GDK_KEY_KP_Enter ||
-      event->keyval == GDK_KEY_ISO_Enter)
+  if (keyval == GDK_KEY_Return ||
+      keyval == GDK_KEY_KP_Enter ||
+      keyval == GDK_KEY_ISO_Enter)
     {
       activate_active_row (completion);
       return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]