[gtk+] colorswatch: Update to using GdkEvent API



commit df4b0340a6322246a9c53295bed33570f56a0f95
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Aug 25 16:44:48 2017 +0200

    colorswatch: Update to using GdkEvent API

 gtk/gtkcolorswatch.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index c14f746..e87d769 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -252,12 +252,16 @@ swatch_key_press (GtkWidget   *widget,
                   GdkEventKey *event)
 {
   GtkColorSwatch *swatch = GTK_COLOR_SWATCH (widget);
+  guint keyval;
 
-  if (event->keyval == GDK_KEY_space ||
-      event->keyval == GDK_KEY_Return ||
-      event->keyval == GDK_KEY_ISO_Enter||
-      event->keyval == GDK_KEY_KP_Enter ||
-      event->keyval == GDK_KEY_KP_Space)
+  if (gdk_event_get_keyval ((GdkEvent *) event, &keyval))
+    return GDK_EVENT_PROPAGATE;
+
+  if (keyval == GDK_KEY_space ||
+      keyval == GDK_KEY_Return ||
+      keyval == GDK_KEY_ISO_Enter||
+      keyval == GDK_KEY_KP_Enter ||
+      keyval == GDK_KEY_KP_Space)
     {
       if (swatch->priv->has_color &&
           swatch->priv->selectable &&


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