]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src: avoid implicit int/bool -> enum conversions
authorJohn Lindgren <john@jlindgren.net>
Fri, 4 Jul 2025 04:37:39 +0000 (00:37 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 21 Jul 2025 14:51:10 +0000 (16:51 +0200)
Use the defined enum constants instead.

src/config/rcxml.c
src/input/keyboard.c

index cc207603b376fe1c2e02804e259cf10cf1cf6037..5dea021a8c8a4f96a4e81e9653498279d0b14c13 100644 (file)
@@ -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;
index 4c53b580da00a0891a138547ccef8a5c80fb770d..15b549f1319c7e2c84fa062c66ed4736d496fc4a 100644 (file)
@@ -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