Use enum wl_pointer_button_state instead of integer
authorDaniel Stone <daniel@fooishbar.org>
Wed, 30 May 2012 15:31:51 +0000 (16:31 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 10 Nov 2013 16:51:29 +0000 (17:51 +0100)
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>
src/evdev-touchpad.c
src/evdev.c

index f658081..d371a65 100644 (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:
index e73f343..a7162fc 100644 (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: