[mutter] clutter: Handle pad button events in clutter_event_get_button()



commit 96aed5fd2e39662ab1098e017d84404ad05fef22
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jun 22 14:24:42 2016 +0200

    clutter: Handle pad button events in clutter_event_get_button()

 clutter/clutter/clutter-event.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c
index 3ba8467..35a1a4d 100644
--- a/clutter/clutter/clutter-event.c
+++ b/clutter/clutter/clutter-event.c
@@ -819,9 +819,15 @@ clutter_event_get_button (const ClutterEvent *event)
 {
   g_return_val_if_fail (event != NULL, 0);
   g_return_val_if_fail (event->type == CLUTTER_BUTTON_PRESS ||
-                        event->type == CLUTTER_BUTTON_RELEASE, 0);
+                        event->type == CLUTTER_BUTTON_RELEASE ||
+                       event->type == CLUTTER_PAD_BUTTON_PRESS ||
+                       event->type == CLUTTER_PAD_BUTTON_RELEASE, 0);
 
-  return event->button.button;
+  if (event->type == CLUTTER_BUTTON_PRESS ||
+      event->type == CLUTTER_BUTTON_RELEASE)
+    return event->button.button;
+  else
+    return event->pad_button.button;
 }
 
 /**


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