XGrabButton

Riza Dindir riza.dindir at gmail.com
Wed Jul 26 14:45:56 UTC 2023


Hello All,

I am grabbing buttons in an xlib. I am new to xlib.

I have 3 grabs (XGrabButton) on buttons. One for button1+Mod1, another
for Button3+Mod1 and the last one for Button1+(Mod1|Control). All
these grabs are for button presses (ButtonPressMask).

When I grab these with 3 different calls to XGrabButton (one for each
of the grabs mentioned above), they work fine. I can operate on
application windows which handle only Button 1 presses (no modifiers,
the application does its own thing with that button press).

But when I call XGrabPointer with AnyButton and AnyModifier (one call.
and handle the modifier filtering in the event handler), this does not
work on windows that process Button 1 presses (with no modifiers).

Since the XGrabPointer call with AnyButton and AnyModifier does grab
for all modifiers and buttons, how should I make it propagate to the
window the button press event (without modifiers). I tried XSendEvent
to send the button press event to that window, but it did not respond.
The application does not operate as expected.

It is perfectly ok for me to use 3 XGrabButton calls, but was
wondering why this would not work for a XGrabButton call with
AnyButton and AnyModifier parameters.

Best Regards
Riza


More information about the xorg mailing list