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>
diff --git a/clients/clickdot.c b/clients/clickdot.c
index d935ae5..be4ee18 100644
--- a/clients/clickdot.c
+++ b/clients/clickdot.c
@@ -197,11 +197,12 @@
static void
button_handler(struct widget *widget,
struct input *input, uint32_t time,
- uint32_t button, uint32_t state, void *data)
+ uint32_t button,
+ enum wl_pointer_button_state state, void *data)
{
struct clickdot *clickdot = data;
- if (state && button == BTN_LEFT)
+ if (state == WL_POINTER_BUTTON_STATE_PRESSED && button == BTN_LEFT)
input_get_position(input, &clickdot->dot.x, &clickdot->dot.y);
widget_schedule_redraw(widget);