How can I catch all mouse events?j

Benjamin M. Schwartz bmschwar at
Mon Jun 2 18:36:40 PDT 2008

Hash: SHA1

Daniel Stone wrote:
| On Mon, Jun 02, 2008 at 03:06:09PM -0400, Benjamin M. Schwartz wrote:
|> I am trying to do something very simple: change the default cursor
|> whenever a mouse button is pressed down, and change back when the button
|> is released.  For example, a normally black cursor graphic might be
|> switched out for one with a white fill to indicate that a mouse button is
|> depressed.  This would be useful for audiences watching a demonstration on
|> a projector, or even looking over a friend's shoulder if you can't hear
|> the audible click.  There are also obvious applications to MPX, but that
|> is more advanced.
|> Question 1: How would you implement this?
| XGrabButton.

Beautiful!  I tried running an Async XGrabButton on the root window, and
it works.  However, despite being in Async mode, the mouse button presses
never reach the underlying window.  I can't click on anything until I kill
my program, because it's absorbing all the button presses.  What am I
doing wrong?  How do I allow the button press event to continue propagating?

- --Ben
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the xorg mailing list