I’d like to do the following: Create a fullscreen, always on top pygtk window with a webkit widget displaying some html, but with a box that is completely transparent, so that the windows below are visible. (This seems to be possible: Is it possible to render web content over a clear background using WebKit?)
What I’d like is to (sometimes) pass all mouse events that occur in the transparent box down to the windows below my application’s window, so that I can interact with them normally. So not just visually transparent, but also transparent to mouse events.
Theoretically, I suppose I could catch all events I am interested in with a pygtk Eventbox, find the window directly below mine with wnck, and pass this event to it with python-xlib.
This doesn’t exactly seem like the most elegant solution; is there a better way?
Forwarding the events won’t work well as you guessed; it creates a lot of race conditions, and some apps will ignore stuff from
XSendEventanyway.What you can do is set the input shape mask. See http://www.x.org/releases/current/doc/xextproto/shape.html and then look at
XFixesSetWindowShapeRegion()in/usr/include/X11/extensions/Xfixes.hwhich lets you specify a shape “kind” (here you wantShapeInput).Something like:
The ability to set
ShapeInputis “only” 5-6 years old so if you care about really crappy old versions of X11, you might be hosed.