From 95b8738f31bef538457a2a64a1feb028d618babc Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 30 May 2012 16:31:51 +0100 Subject: [PATCH] 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 --- src/evdev-touchpad.c | 4 +++- src/evdev.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c index f6580810..d371a659 100644 --- a/src/evdev-touchpad.c +++ b/src/evdev-touchpad.c @@ -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: diff --git a/src/evdev.c b/src/evdev.c index e73f343c..a7162fcc 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -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: