bulletmark / libinput-gestures

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

Does not detect if touchpad is disconnected #336

Closed fatg3erman closed 2 years ago

fatg3erman commented 2 years ago
libinput-gestures: session KDE+x11 on Linux-5.13.0-41-generic-x86_64-with-glibc2.34, python 3.9.7, libinput 1.18.1
Hash: 8d8b6a109b84473e049faaf97c63aa33
Gestures configured in /etc/libinput-gestures.conf:
swipe left       4 _internal ws_up -w
swipe right      4 _internal ws_down -w
libinput-gestures: device /dev/input/by-path/pci-0000:00:14.0-usb-0:3.1:1.1-event-mouse(event10): Polo-Leader MANO-603 Touchpad
libinput-gestures is installed.
libinput-gestures is set up as a desktop application.
libinput-gestures is currently running as a desktop application.
libinput-gestures is set to autostart as a desktop application.
libinput-gestures is using default configuration file.

I'm using an external USB touchpad. If I disconnect the touchpad and reconnect it (which happens a lot as it's attached through a KVM) libinput-gestures stops working. I've run it with the -v option - it doesn't exit, and it doesn't report any errors - it simply stops producing any output.

At a guess I'd say that the device it is reading from gets closed when I disconnect the touchpad, but libinput-debug-events doesn't notice this. Reconnecting it re-creates the same device path but libinput-debug-events doesn't reopen it.

I did a test, hacking the python code so it doesn't supply a path, just runs libinput-debug-events with no arguments. This fixes the problem.

bulletmark commented 2 years ago

No need to hack the code, just read the documentation(!). If you set device all in your configuration file then that removes the device specifier on the libinput debug-events command and you get all events, i.e. the same as what you hacked. Read the comments about the device command in the sample configuration file. The reason I prefer to not do this by default is (as I say in the conf/docs) that it imposes a significantly larger performance cost because that way libinput-gestures is receiving ALL libinput events rather than the much smaller subset it really only needs.

Secondly, the issue about using a removable touchpad has been discussed in older issues here previously and a solution is already described in the documentation.

fatg3erman commented 2 years ago

Perfect! Thank you. Sorry for not RTFM!