diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-16 07:24:46 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-16 07:24:46 -0400 |
commit | beb84940cf26eebcdaf21cb9ec81df485701e65f (patch) | |
tree | 19b622776854f794979217ad2a545a9e26adc7aa | |
parent | 3ac10a81bde8fd7fa5135053fb0a6ffac61d4721 (diff) |
Improve no device detection support
-rw-r--r-- | backend/libinput/backend.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/backend/libinput/backend.c b/backend/libinput/backend.c index 7dc1cc01..28947a5e 100644 --- a/backend/libinput/backend.c +++ b/backend/libinput/backend.c @@ -64,10 +64,17 @@ static bool wlr_libinput_backend_start(struct wlr_backend *_backend) { libinput_log_set_priority(backend->libinput_context, LIBINPUT_LOG_PRIORITY_ERROR); int libinput_fd = libinput_get_fd(backend->libinput_context); - if (backend->wlr_device_lists->length == 0) { + char *no_devs = getenv("WLR_LIBINPUT_NO_DEVICES"); + if (no_devs) { + if (strcmp(no_devs, "1") != 0) { + no_devs = NULL; + } + } + if (!no_devs && backend->wlr_device_lists->length == 0) { wlr_libinput_readable(libinput_fd, WL_EVENT_READABLE, backend); if (backend->wlr_device_lists->length == 0) { - wlr_log(L_ERROR, "No input device found, failing initialization"); + wlr_log(L_ERROR, "libinput initialization failed, no input devices"); + wlr_log(L_ERROR, "Set WLR_LIBINPUT_NO_DEVICES=1 to suppress this check"); return false; } } |