diff --git a/tools/libinput-list-devices.c b/tools/libinput-list-devices.c index aa225ca0..4cbdf775 100644 --- a/tools/libinput-list-devices.c +++ b/tools/libinput-list-devices.c @@ -372,6 +372,7 @@ main(int argc, char **argv) { struct libinput *li; struct libinput_event *ev; + bool grab = false; /* This is kept for backwards-compatibility with the old libinput-list-devices */ @@ -388,7 +389,7 @@ main(int argc, char **argv) } } - li = tools_open_backend(BACKEND_UDEV, "seat0", false, false); + li = tools_open_backend(BACKEND_UDEV, "seat0", false, &grab); if (!li) return 1; diff --git a/tools/shared.c b/tools/shared.c index d1f02702..d3fb6294 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -232,7 +232,7 @@ open_restricted(const char *path, int flags, void *user_data) if (fd < 0) fprintf(stderr, "Failed to open %s (%s)\n", path, strerror(errno)); - else if (*grab && ioctl(fd, EVIOCGRAB, (void*)1) == -1) + else if (grab && *grab && ioctl(fd, EVIOCGRAB, (void*)1) == -1) fprintf(stderr, "Grab requested, but failed for %s (%s)\n", path, strerror(errno));