Use enum wl_keyboard_key_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_keyboard_key_state enum, and explicit comparisons.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/shell.c b/src/shell.c
index 8f4822f..bca7afc 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2482,11 +2482,12 @@
static void
switcher_key(struct wl_keyboard_grab *grab,
- uint32_t time, uint32_t key, uint32_t state)
+ uint32_t time, uint32_t key, uint32_t state_w)
{
struct switcher *switcher = container_of(grab, struct switcher, grab);
+ enum wl_keyboard_key_state state = state_w;
- if (key == KEY_TAB && state)
+ if (key == KEY_TAB && state == WL_KEYBOARD_KEY_STATE_PRESSED)
switcher_next(switcher);
}