aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput
diff options
context:
space:
mode:
authorAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-08-19 10:10:52 -0400
committerAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-08-22 10:18:52 -0400
commit8bd7170fd95aa0753dc859457808d7f7f81d560d (patch)
treeb51d0586fae5ab51af9728616bbc9c2c91662d5f /backend/libinput
parent31a9fc1fb60f8001f43186d36e3fbb5fce584d91 (diff)
Use env helpers
Diffstat (limited to 'backend/libinput')
-rw-r--r--backend/libinput/backend.c10
1 files changed, 3 insertions, 7 deletions
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 <wlr/backend/session.h>
#include <wlr/util/log.h>
#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");