[mutter/wip/tablet-protocol-v2: 27/70] clutter: Handle pad button events in clutter_event_get_button()



commit 0342ffe771f1c09c13fae0208e861b23de6e8d8a
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 10ba96c..397327e 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]