I am creating a program that highlights the mouse cursor and shows mouse clicks for screencasts in Wayland.
My current approach is to create a full-screen transparent layer surface, where I would draw for example a translucent circle around the mouse cursor. However, I can’t find a way to both receive pointer events (so that I can change the color of the circle when the user clicks), but to also allow the events to pass through to the application below at the same time.
One workaround I came up with is to turn off the input region of my program and read the input events manually using libinput, but this requires sudo which I would like to avoid.
I also tried to use a virtual pointer, but that creates events that are still received by my program and not passed through.
Is there any way to achieve this from a Wayland client through the compositor, without libinput?