Use enum wl_pointer_button_state instead of integer

Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Daniel Stone 2012-05-30 16:31:51 +01:00 committed by Jonas Ådahl
parent a6cd4965e9
commit 95b8738f31
2 changed files with 6 additions and 2 deletions

View file

@ -444,7 +444,9 @@ process_key(struct touchpad_dispatch *touchpad,
case BTN_BACK:
case BTN_TASK:
notify_button(&device->master->base.seat,
time, e->code, e->value);
time, e->code,
e->value ? WL_POINTER_BUTTON_STATE_PRESSED :
WL_POINTER_BUTTON_STATE_RELEASED);
break;
case BTN_TOOL_PEN:
case BTN_TOOL_RUBBER:

View file

@ -79,7 +79,9 @@ evdev_process_key(struct evdev_input_device *device,
case BTN_BACK:
case BTN_TASK:
notify_button(&device->master->base.seat,
time, e->code, e->value);
time, e->code,
e->value ? WL_POINTER_BUTTON_STATE_PRESSED :
WL_POINTER_BUTTON_STATE_RELEASED);
break;
default: