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

Synthetic events can cause an infinite loop #20

Open
0ion9 opened this issue Jan 11, 2014 · 2 comments
Open

Synthetic events can cause an infinite loop #20

0ion9 opened this issue Jan 11, 2014 · 2 comments

Comments

@0ion9
Copy link

0ion9 commented Jan 11, 2014

shift + s
    xdotool type S

This is an unrealistic example; my actual use case involves conditionally passing the captured event to the current window (so I can't use ~, it will unconditionally pass on the event)

AFAICS the fix involves ungrabbing the key immediately before executing the command, and regrabbing it after the command returns.

That still leaves the possibility of forking commands causing a loop, but nobody can do anything to avoid that, I think, aside from just not doing things that cause race conditions :)

@anko
Copy link

anko commented Oct 23, 2014

A more local way to implement that would be to create a cancelable-replay keysym modifier (maybe ~~ or ?), for which a command exiting with a non-zero status indicates the event shouldn't be replayed.

I'm proposing a different modifier because I imagine ~ is allowed to run the event replay and the command in parallel. We probably want to keep that optimisation, so you can run time-consuming commands without blocking/lagging the UI.

@wawe
Copy link

wawe commented Apr 9, 2015

One way of working around this is to pass the synthetic event directly to a specific window.
E.g. to pass an event to the currently focused window using xdotool:

shift+s
    xdotool getwindowfocus type --window %@ S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants