Skip to content
Advertisement

Propagating all events from a X window

I’a currently working on a small utility, it’s my first ever X project. The utility is used to draw a small circle around your mouse pointer. I use an app called Pinpoint to do the same on my Mac, it helps me find my mouse as I’m visually impaired.

The utility creates an transparent X window and draw a circle inside, it then moves that window with the mouse pointer so that the circle follows the mouse.

It currently works, except for one detail. Mouse events are not propagated up to the underlying windows. Basically, the utility makes the mouse useless.

As far as I can tell from the Xlib docs, if not otherwise specified, new windows should propagate all events. How can I fix this?

The code can be found on GitHub: https://github.com/blubber/circle-cursor it’s a bit messy currently, becaue it is just a proof of concept.

Advertisement

Answer

I would suggest doing via cursor image as well, there are many ways when you won’t be able to receive mouse events and only possible source would be polling with XQueryPointer.

With xfixes extension you can subscribe to all cursor image changed events and get most recent shape of the cursor, and whit XRender you can set your own ( possibly animated cursor )

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement