summarylogtreecommitdiffstats
path: root/dc4dc54c5ebac7e4b455d8df35076fc044a581a7.patch
blob: 211d5e4ea01ea1d472002ae44743c3365329fd54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From dc4dc54c5ebac7e4b455d8df35076fc044a581a7 Mon Sep 17 00:00:00 2001
From: Tasos Sahanidis <tasos@tasossah.com>
Date: Mon, 20 Sep 2021 14:48:18 +0300
Subject: [PATCH] Don't enable unneeded axes in mouse device

Specifically, we used to enable HI_RES wheel events without ever
sending any. This breaks scrolling in latest libinput as it expects
us to actually send HI_RES events.
---
 src/daemon/input_linux.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/daemon/input_linux.c b/src/daemon/input_linux.c
index 68cc0ebb..a9ac8c8e 100644
--- a/src/daemon/input_linux.c
+++ b/src/daemon/input_linux.c
@@ -25,8 +25,10 @@ int uinputopen(struct uinput_user_dev* indev, int mouse){
             ioctl(fd, UI_SET_KEYBIT, i);
         // Enable mouse axes
         ioctl(fd, UI_SET_EVBIT, EV_REL);
-        for(int i = 0; i < REL_CNT; i++)
-            ioctl(fd, UI_SET_RELBIT, i);
+        ioctl(fd, UI_SET_RELBIT, REL_X);
+        ioctl(fd, UI_SET_RELBIT, REL_Y);
+        ioctl(fd, UI_SET_RELBIT, REL_WHEEL);
+        ioctl(fd, UI_SET_RELBIT, REL_HWHEEL);
     } else {
         // Enable common keyboard keys
         for(int i = KEY_ESC; i <= KEY_MEDIA; i++)