clutter: Handle pad button events in clutter_event_get_button()

This commit is contained in:
Carlos Garnacho 2016-06-22 14:24:42 +02:00
parent 88c510c38a
commit 96aed5fd2e

View File

@ -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 != NULL, 0);
g_return_val_if_fail (event->type == CLUTTER_BUTTON_PRESS || 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;
} }
/** /**