Skip to content

Commit 7b3e859

Browse files
committed
Make sure xinput is run silently
Users of XWayland/Wayland that has xinput installed will be receiving warning/errors due to xinput being used in a wayland sesison, it's safe to ignore it. We could also try to find if we're in a wayland session by using Xlibs, but I think this would've been overkill
1 parent 7d78656 commit 7b3e859

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Daemon/ydotoold.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,21 @@ int main(int argc, char **argv) {
357357
const char *xinput_path = "/usr/bin/xinput";
358358

359359
if (getenv("DISPLAY")) {
360-
if (getenv("WAYLAND_DISPLAY")) {
361-
362-
}
363-
else if (stat(xinput_path, &sbuf) == 0) {
360+
if (stat(xinput_path, &sbuf) == 0) {
364361
pid_t npid = vfork();
365362

366363
if (npid == 0) {
364+
// Make sure we don't warning unnecessarily if user is on XWayland session
365+
freopen("/dev/null", "w", stderr);
366+
367367
execl(xinput_path, "xinput", "--set-prop", "pointer:ydotoold virtual device", "libinput Accel Profile Enabled", "0,", "1", NULL);
368-
perror("failed to run xinput command");
368+
printf("failed to run xinput command\n");
369369
_exit(2);
370370
} else if (npid == -1) {
371371
perror("failed to fork");
372372
}
373373
} else {
374-
printf("xinput command not found in `%s', not disabling mouser pointer acceleration", xinput_path);
374+
printf("xinput command not found in `%s', not disabling mouser pointer acceleration\n", xinput_path);
375375
}
376376
}
377377

0 commit comments

Comments
 (0)