Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command delay #151

Closed
stefanocirici opened this issue May 4, 2018 · 11 comments

Comments

Projects
None yet
5 participants
@stefanocirici
Copy link

commented May 4, 2018

Running libinput-gestures -d I can see that the command is recognized very quickly but the action is done with 1.5-2 second of delay.

This happen for all xdotool key action (eg. xdotool key super+Left, xdotool key control+Tab etc)
Only xdotool set_desktop --relative 1 is responsive.
Command like gesture swipe up 4 dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();' are responsive too.

@bulletmark

This comment has been minimized.

Copy link
Owner

commented May 4, 2018

Can you please be clear on what delay you are quoting? What is the exact start point you are timing from? This utility simply invokes the configured command when libinput signals the end of a gesture so if you take 1.5 secs to move your fingers up then the command will only get executed when you finally lift your fingers off the touchpad. E.g. if you swipe up but then decide to cancel the gesture you can move sideways off the touchpad or move back to the start point then libinput will "cancel" the gesture and libnput-gestures will do nothing.

In practice people just do a short quick flick up or down (e.g. to change their workspace) and the speed s fine. Note that Mac and Windows do the same thing and only action the gesture at the end when you lift your fingers (although in those cases they show you an animation/preview of what is about to happen which is admittedly very nice).

@stefanocirici

This comment has been minimized.

Copy link
Author

commented May 7, 2018

The delay I was talking is (hand calculated) from when I see the end of gesture (in libinput-gestures -r log) to when the gesture action is performed. The gesture is recognized very quickly (e.g. from GESTURE_SWIPE_BEGIN to GESTURE_SWIPE_END) but the action has some delay.

@bulletmark

This comment has been minimized.

Copy link
Owner

commented May 7, 2018

Please paste output of libinput-gestures -l here so I can see your environment and configuration. This is a simple and lightweight utility so there should be no delay.

@stefanocirici

This comment has been minimized.

Copy link
Author

commented May 7, 2018

$ libinput-gestures -l
libinput-gestures: session ubuntu+x11 on Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic, python 3.6.5, libinput 1.10.4
Gestures configured in ~/.config/libinput-gestures.conf:
swipe up         3 xdotool set_desktop --relative 1
swipe down       3 xdotool set_desktop --relative -- -1
swipe left       3 xdotool key super+Left
swipe right      3 xdotool key super+Right
swipe left       4 xdotool key alt+Escape
swipe right      4 xdotool key shift+alt+Escape
swipe up         4 dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:Main.overview.toggle();
swipe down       4 xdotool key super+x
swipe right_up   3 xdotool key control+Tab
swipe left_up    3 xdotool key control+shift+Tab
swipe left_down  3 xdotool key control+w
swipe right_down 3 xdotool key control+shift+t
pinch in           xdotool key ctrl+minus
pinch out          xdotool key ctrl+plus
libinput-gestures: device /dev/input/event19: ELAN1300:00 04F3:3059 Touchpad

EDIT:
I think the delay is caused by xdotool. Executing a single command (e.g xdotool key super) has the same delay I was talking above.
Is there an alternative of using xdotool?

@bulletmark

This comment has been minimized.

Copy link
Owner

commented May 7, 2018

Always test your xdotool command before you configure it in libinput-gestures.conf.

xdotool does not delay at all on my system and I have never heard of anybody else saying it so there is likely a configuration error on your system. Play around with other tools which query your X server (e.g. xdpyinfo and see if they have a delay).

@bulletmark bulletmark closed this May 7, 2018

@stefanocirici

This comment has been minimized.

Copy link
Author

commented May 8, 2018

I found the problem. It seems that when you use two or more keyboard layout, xdotool has this delay in all layouts but the main one. I am not sure while this happen.

@bianchinirick

This comment has been minimized.

Copy link

commented Jun 3, 2018

When I use gnome-shell (ubuntu-18.04), I have the exactly same problem. I'm surprised that no one else commented about this problem. I really think that it's a gnome-shell problem. The same occurs on HDMI monitors when press the volume up shortcut. That is an annoing problem.

@ddnexus

This comment has been minimized.

Copy link

commented Jun 15, 2018

Same annoying problem here (ubuntu-18.04). I almost never use the second layout and I discovered this only accidentally by switching it. The problem is very easily reproducible.

It looks like it is a problem of the xdotool command and it has nothing to do with libinput-gestures. You get it also by running the command directly in the terminal.

@Ospeto

This comment has been minimized.

Copy link

commented Mar 31, 2019

How to solve this problem with two keyboard layout? I must use two keyboard layout for my mother language and English.

@Ospeto

This comment has been minimized.

Copy link

commented Mar 31, 2019

Same annoying problem here (ubuntu-18.04). I almost never use the second layout and I discovered this only accidentally by switching it. The problem is very easily reproducible.

It looks like it is a problem of the xdotool command and it has nothing to do with libinput-gestures. You get it also by running the command directly in the terminal.

How to solve this problem with two keyboard layout? I must use two keyboard layout for my mother language and English.

@ddnexus

This comment has been minimized.

Copy link

commented Apr 2, 2019

It is a bug still open after many years: jordansissel/xdotool#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.