Hi,

I'd like my app to listen to all mouse move events regardless over which window they occur as long as my window has the focus. Normally, MotionNotify is only delivered as long as the mouse pointer is within my window's boundaries. As soon as the user moves the pointer out of the window's boundaries, I get a LeaveNotify event and then nothing more. This is not sufficient for my purposes... as long as my window has the focus, I want to be informed about the mouse pointer location, even if it is outside of my window's boundaries.

How could this be achieved? I already tried these approaches:

1) Grab the pointer using XGrabPointer(). Not an acceptable solution because it seems to lock the mouse buttons, i.e. when XGrabPointer() is active, the user is unable to click anything. The mouse buttons seem locked.

2) Install a 50hz interval function that reads the current position using XQueryPointer(). This works fine but of course it's awkward because it calls the X server 50 times a second... not very nice.

So I'm wondering... how would you guys do this? Anyone got a better solution?

Thanks,

Andy