bulletmark / libinput-gestures

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

Slow gestures reaction on other languages that English (Russian tested) #281

Closed interkelstar closed 3 years ago

interkelstar commented 3 years ago

I have Ubuntu 20.10 installed, along with libinput-gestures. I have several gestures set up, one of them is swipe 3 fingers down to ctrl+alt+Up When i have english language selected everything works pretty fine. However, i have also russian language in my system and when currently selected language is russian it takes seconds for gesture to make a reaction. Interestingly it can be seen with cursor. While i am at Chrome and i can see cursor blinking, then i make a 3-finger swipe and see that cursor stopped to blink, stuck, for a 2 secorns approximately and only then desktops are changed.

bulletmark commented 3 years ago

Please note the bold sentence in the opening paragraph of the troubleshooting section.

IlliaBalia commented 3 years ago

I experience the same issue with slower response when using other languages than English (say, Ukrainian). Here is the output of libinput-gestures -l

libinput-gestures: session ubuntu+x11 on Linux-5.4.0-54-generic-x86_64-with-glibc2.29, python 3.8.5, libinput 1.15.5
/usr/bin/libinput-gestures: hash 0f92076ca945416b73f4362e9e3e6979
Gestures configured in ~/.config/libinput-gestures.conf:
swipe up           _internal ws_up
swipe down         _internal ws_down
swipe left       3 xdotool key alt+Right
swipe left       4 xdotool key super+Tab
swipe right      3 xdotool key alt+Left
swipe right      4 xdotool key super+Tab
swipe right_up   3 xdotool key control+shift+t
swipe left_up    3 xdotool key control+shift+Tab
swipe left_down  3 xdotool key control+w
swipe right_down 3 xdotool key control+Tab
swipe left_down  4 xdotool key Alt+F4
swipe right_down 4 xdotool key super+h
swipe left_up    4 xdotool key super+Up
swipe right_up   4 xdotool key super+Down
swipe up         3 xdotool key XF86AudioRaiseVolume
swipe down       3 xdotool key XF86AudioLowerVolume
swipe up         4 xdotool key super+s
swipe down       4 xdotool key super+s
pinch in         2 xdotool key alt+q
pinch out        2 xdotool key alt+q
pinch clockwise  2 xdotool key control+t
pinch anticlockwise 2 xdotool key control+w
pinch clockwise  3 xdotool key super+asciitilde
pinch anticlockwise 3 xdotool key super+asciitilde
libinput-gestures: device /dev/input/by-path/pci-0000:00:15.1-platform-i2c_designware.1-event-mouse(event7): ELAN1200:00 04F3:309C Touchpad
bulletmark commented 3 years ago

I can't see how libinput-gestures could affect this? Which of your configured commands has this problem? Please note step 7 of the trouble-shooting section, i.e. run your xdotool commands manually on the command line and check if that "slower response" is occurring.

Note your configuration shown above is redundant. Swipe commands can only take 3 or 4 fingers and you have explicitly configured both for swipe up and down so that means the first 2 commands in your configuration are ignored. I will make a code change to output a configuration error message at startup for this case.

bulletmark commented 3 years ago

New version 2.55 adds that check. Note this is not relevant to the "slow response" issue here. It just adds a check to output an error message for configurations like @IlliaBalia above since he may not have been aware.

IlliaBalia commented 3 years ago

@bulletmark thank you, Mark - did not notice the redundancy of the first two commands in the config, never used them. Appreciate you effort to provide validation.

Which of your configured commands has this problem?

All of them

Update on the issue: doing steps 4,5 and 7 of the Troubleshooting section showed no errors. There was no delay between the gesture input and the correspondent command when run in debug or raw modes, regardless of the language chosen.

interkelstar commented 3 years ago

Sorry that I didn't provide additional information during initial post, and thank you for the link to the troubleshooting steps. Indeed, after testing by my own, I figured out that it's xdotool issue. If I run any xdotool from the terminal while other language is active I can experience a significant delay and increasing cpu load. When I changed command from xdotool to similar with dbus-send everything began to work quickly. I think that I've even found root cause https://github.com/jordansissel/xdotool/issues/231

IlliaBalia commented 3 years ago

@kelstar95 thank you for the valuable input 👍🏻 Could you please provide an example of the same command using xdotool and dbus-send? Can the key codes (like super+Tab) remain the same?

interkelstar commented 3 years ago

@IlliaBalia unfortunately, I am not very familiar with internals of GNOME and I had to search each command individually and I didn't find everything (for instance, i didn't find replacement for ctrl+shift+alt+down action which moves current window one workspace down which is very convenient to use with gesture 3-fingers-left) But what I did find is command for switching workspaces (i use with 3-fingers-up/down), open activity view, show applications and hide all windows, here are the links that i found:

https://discourse.gnome.org/t/how-to-go-to-next-previous-workspace-from-command-line/3126 https://askubuntu.com/questions/1201849/invoking-gnome-show-applications-from-command-line

bulletmark commented 3 years ago

Note that trouble-shooting step 7 says to ensure to test your xdotool commands manually which if had been done would have shown this problem was not due to libinput-gestures.