From 8b7ae52a912a4afadf7382108838f8a4a15e6350 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Fri, 4 Jul 2025 00:37:39 -0400 Subject: [PATCH] src: avoid implicit int/bool -> enum conversions Use the defined enum constants instead. --- src/config/rcxml.c | 2 +- src/input/keyboard.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/config/rcxml.c b/src/config/rcxml.c index cc207603..5dea021a 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -1556,7 +1556,7 @@ rcxml_init(void) rc.gap = 0; rc.adaptive_sync = LAB_ADAPTIVE_SYNC_DISABLED; - rc.allow_tearing = false; + rc.allow_tearing = LAB_TEARING_DISABLED; rc.auto_enable_outputs = true; rc.reuse_output_mode = false; rc.xwayland_persistence = false; diff --git a/src/input/keyboard.c b/src/input/keyboard.c index 4c53b580..15b549f1 100644 --- a/src/input/keyboard.c +++ b/src/input/keyboard.c @@ -387,7 +387,7 @@ get_keyinfo(struct wlr_keyboard *wlr_keyboard, uint32_t evdev_keycode) return keyinfo; } -static bool +static enum lab_key_handled handle_key_release(struct server *server, uint32_t evdev_keycode) { /* @@ -395,7 +395,7 @@ handle_key_release(struct server *server, uint32_t evdev_keycode) * forwarded to clients to avoid stuck keys. */ if (!key_state_corresponding_press_event_was_bound(evdev_keycode)) { - return false; + return LAB_KEY_HANDLED_FALSE; } /* @@ -416,7 +416,7 @@ handle_key_release(struct server *server, uint32_t evdev_keycode) * not forward the corresponding release event to clients. */ key_state_bound_key_remove(evdev_keycode); - return true; + return LAB_KEY_HANDLED_TRUE; } static bool @@ -518,10 +518,10 @@ handle_compositor_keybindings(struct keyboard *keyboard, key_state_bound_key_remove(event->keycode); if (locked && !cur_keybind->allow_when_locked) { cur_keybind = NULL; - return true; + return LAB_KEY_HANDLED_TRUE; } actions_run(NULL, server, &cur_keybind->actions, NULL); - return true; + return LAB_KEY_HANDLED_TRUE; } else { return handle_key_release(server, event->keycode); } @@ -542,11 +542,11 @@ handle_compositor_keybindings(struct keyboard *keyboard, if (server->input_mode == LAB_INPUT_STATE_MENU) { key_state_store_pressed_key_as_bound(event->keycode); handle_menu_keys(server, &keyinfo.translated); - return true; + return LAB_KEY_HANDLED_TRUE; } else if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) { if (handle_cycle_view_key(server, &keyinfo)) { key_state_store_pressed_key_as_bound(event->keycode); - return true; + return LAB_KEY_HANDLED_TRUE; } } } @@ -565,10 +565,10 @@ handle_compositor_keybindings(struct keyboard *keyboard, if (!cur_keybind->on_release) { actions_run(NULL, server, &cur_keybind->actions, NULL); } - return true; + return LAB_KEY_HANDLED_TRUE; } - return false; + return LAB_KEY_HANDLED_FALSE; } static int