bindings: Do not grab pointer when executing bindings #5755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Grabing the pointer produces a
GrabFrozen
error in applications that are run from key bindings. Since we don't need the pointer in such cases, we can change the call to use ASYNC. This seems to be a historical leftover.I've tested locally that these still work:
Even in the main branch, I actually couldn't get
import
andxdotool
to fail with the pointer being frozen, potentially because these programs wait a bit for the pointer to be unfrozen like i3lock does.This patch came up in
#5735 (comment)
I wonder why the pointer is actually grabbed.
The argument I change in
xcb_grab_key
there, ispointer_mode
, from https://www.x.org/releases/X11R7.7/doc/man/man3/xcb_grab_key.3.xhtml:I traced via
git blame
the usage ofxcb_grab_key
throughout 14 years of i3 development and it seems thatpointer_mode
was always set toXCB_GRAB_MODE_SYNC
, going all the way back tob664456.
Fixes #5735