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 c789459a31
commit 04629d2bc2

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);
if (event->type == CLUTTER_BUTTON_PRESS ||
event->type == CLUTTER_BUTTON_RELEASE)
return event->button.button; return event->button.button;
else
return event->pad_button.button;
} }
/** /**