From 8bd7170fd95aa0753dc859457808d7f7f81d560d Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Fri, 19 Aug 2022 10:10:52 -0400 Subject: Use env helpers --- backend/libinput/backend.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'backend/libinput') diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 02c2f64b..688fae5d 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -6,6 +6,7 @@ #include #include #include "backend/libinput.h" +#include "util/env.h" static struct wlr_libinput_backend *get_libinput_backend_from_backend( struct wlr_backend *wlr_backend) { @@ -103,13 +104,8 @@ static bool backend_start(struct wlr_backend *wlr_backend) { libinput_log_set_priority(backend->libinput_context, LIBINPUT_LOG_PRIORITY_ERROR); int libinput_fd = libinput_get_fd(backend->libinput_context); - char *no_devs = getenv("WLR_LIBINPUT_NO_DEVICES"); - if (no_devs) { - if (strcmp(no_devs, "1") != 0) { - no_devs = NULL; - } - } - if (!no_devs && wl_list_empty(&backend->devices)) { + + if (!env_parse_bool("WLR_LIBINPUT_NO_DEVICES") && wl_list_empty(&backend->devices)) { handle_libinput_readable(libinput_fd, WL_EVENT_READABLE, backend); if (wl_list_empty(&backend->devices)) { wlr_log(WLR_ERROR, "libinput initialization failed, no input devices"); -- cgit v1.2.3