XGrabButton

Po Lu luangruo at yahoo.com
Thu Jul 27 12:53:22 UTC 2023


Riza Dindir <riza.dindir at gmail.com> writes:

> 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.

The application in question might be using the X input extension and
only responding to XI events, and you likely forgot to change the event
window contained in the event before resending it to the application.

It's generally a bad idea to intercept and ``resend'' events to other X
clients, as you are required to translate the event coordinates
yourself, and the recipients will see events arrive with their
timestamps out-of-order.  Additionally, you will have to translate input
extension events generated by both versions of the extension, and any
generated by extensions that haven't yet been invented.


More information about the xorg mailing list