From 96aed5fd2e39662ab1098e017d84404ad05fef22 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 22 Jun 2016 14:24:42 +0200 Subject: [PATCH] clutter: Handle pad button events in clutter_event_get_button() --- clutter/clutter/clutter-event.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c index 3ba846759..35a1a4d18 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; } /**