bulletmark / libinput-gestures

Actions gestures on your touchpad using libinput
3.9k stars 241 forks source link

4 fingers gestures sometimes prevent 3 fingers gestures #297

Closed ozls closed 3 years ago

ozls commented 3 years ago

Hello! Thanks a lot for this tool, it is amazing and I have used it accross two laptops, different distros and DE, on X and now on Wayland. I have a small bug to report that's been around as long as I remember, I couldn't find anything posted here so I apologize if it's already been discussed.

Sometimes, after a 4 fingers swipe gestures, 3 fingers gestures will start being interpreted as 2 finger gestures. For instance, a 3 fingers swipe up will be interpreted as a scroll. This also goes for a three finger tap, which gets interpreted as a right-click. The bug goes aways after a single new 4 fingers gesture (a simple tap will do), and 3 fingers gestures start working again normally.

This is not a big deal obviously, but I'm curious about this behaviour and I'd be thankful to anybody looking into this.

This is the output of libinput-gestures -l :

libinput-gestures: session sway+wayland on Linux-5.11.9-arch1-1-x86_64-with-glibc2.33, python 3.9.2, libinput 1.17.1 /usr/bin/libinput-gestures: hash f264e6fcfd567b8d762ed65e3981f653 Gestures configured in ~/.config/libinput-gestures.conf: swipe left 4 swaymsg workspace next swipe right 4 swaymsg workspace prev swipe left 3 ydotool key Alt+Right swipe right 3 ydotool key Alt+Left swipe down 3 swaymsg fullscreen toggle swipe up 3 swaymsg floating toggle swipe up 4 python3 /home/oz/Documents/Scripts/new-ws.py swipe_threshold 20 libinput-gestures: device /dev/input/by-path/platform-i8042-serio-1-event-mouse(event8): SynPS/2 Synaptics TouchPad

bulletmark commented 3 years ago

You say "that's been around as long as I remember" and you say you have used it across two laptops so please confirm you have experienced this bug on two different laptops. I can't imagine any way that libinput-gestures could have an intermittent error like this and would presume that it is something about your particular touchpad but that is unlikely if you are claiming to have the bug on different laptops. Please stop libinput-gestures and run the native libinput tool to see events:

libinput-gestures-setup stop
libinput debug-events

Then do a mix of gestures to see if you can reproduce this bug. libinput-gestures merely parses the log produced by libinput debug-events so I would expect to see this problem shown in this log if is something due to your hardware etc.

After that, just try running libinput-gestures -d in a terminal then do a heap of gestures. That will print out the gestures and the actions but won't invoke anything so you can see whether the problem is within libinput-gestures, or some side-effect of the command (e.g. swaymsg) that you are running.

ozls commented 3 years ago

I'm sorry, I could have been more clear. I had this exact issue with my previous laptop as well, and when I noticed it on this new one I decided to report it. Both were Lenovo but bought 8 years apart. Other similarities include an Arch-based distribution (Manjaro on the last one, Endeavour on this one). It cannot come from the commands I use, because I noticed it using all sorts of commands, and on Gnome as well.

I had already done some debugging at the libinput-gestures level, and I noticed nothing except 3 fingers gestures being registered as scrolls. But your answer prompted me to use the libinput debugging tool with libinput-gestures turned completely off, and it appears the issue is present as well. Here is a sample of the output with vertical swipes:

Normal 3 fingers gestures :

event8 GESTURE_SWIPE_UPDATE +13.149s 3 -1.00/10.30 (-3.75/38.53 unaccelerated) event8 GESTURE_SWIPE_UPDATE +13.175s 3 -0.33/ 6.24 (-1.25/23.34 unaccelerated) event8 GESTURE_SWIPE_END +13.199s 3

Series of 4 fingers gestures :

event8 GESTURE_SWIPE_BEGIN +13.712s 4 event8 GESTURE_SWIPE_UPDATE +13.712s 4 0.58/-10.90 ( 2.19/-40.78 unaccelerated) event8 GESTURE_SWIPE_UPDATE +13.738s 4 5.10/-17.97 (19.06/-67.21 unaccelerated) event8 GESTURE_SWIPE_UPDATE +13.764s 4 0.00/-2.41 ( 0.00/-9.00 unaccelerated) event8 GESTURE_SWIPE_END +13.799s 4 event8 GESTURE_SWIPE_BEGIN +14.122s 4 event8 GESTURE_SWIPE_UPDATE +14.122s 4 1.00/-6.02 ( 3.75/-22.50 unaccelerated) event8 GESTURE_SWIPE_UPDATE +14.148s 4 0.42/-1.80 ( 1.56/-6.75 unaccelerated) event8 GESTURE_SWIPE_END +14.170s 4

These are 3 fingers gestures being recognized as scrolling:

event8 POINTER_AXIS +14.697s vert 19.16/0 horiz 0.00/0 (finger) event8 POINTER_AXIS +14.722s vert 9.39/0 horiz 0.00/0 (finger) event8 POINTER_AXIS +14.747s vert -84.52/0 horiz 93.24/0 (finger) event8 POINTER_AXIS +14.771s vert 0.00/0 horiz 0.00/0 (finger) event8 POINTER_AXIS +15.758s vert 16.45/0* horiz 0.00/0 (finger)

I think this proves it does not come from libinput-gestures at all but from libinput itself, so I apologize for the inconvenience. This issue can be closed. That being said, I would appreciate any pointers on where to look in order to solve the problem.

bulletmark commented 3 years ago

You don't say above how you initiate that 3rd state? No matter what I tried using my touchpad, 3 and 4 finger gestures were always reported properly. Anyhow, as you say this is not a bug with libinput-gestures so closing this.