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?
The gtk.Window widget emits the following signals − This is emitted when the default child widget of window is activated usually by the user pressing the Return or Enter key. This is emitted when the child widget with the focus is activated usually by the user pressing the Space key.
An object of the gtk.Window class provides a widget that users commonly think of as a Wwindow. This widget is a container hence, it can hold one child widget. It provides a displayable area decorated with title bar and resizing controls.
Some of the important methods of the gtk.Window class are listed below − This sets the "title" property of the gtk.window to the value specified by the title. The title of a window will be displayed in its title bar. This returns the title of a window if set. This sets the position of window. The predefined position constants are −
This is emitted when the child widget with the focus is activated usually by the user pressing the Space key. This is emitted when the focus is changed within the window's child widgets when the user presses the Tab, the Shift+Tab or the Up, Down, Left or Right arrow keys. This is emitted when the focus changes to widget in window.
Forwarding the events won't work well as you guessed; it creates a lot of race conditions, and some apps will ignore stuff from XSendEvent
anyway.
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.h
which lets you specify a shape "kind" (here you want ShapeInput
).
Something like:
XRectangle rect;
XserverRegion region = XFixesCreateRegion(display, &rect, 1);
XFixesSetWindowShapeRegion(display, window, ShapeInput, 0, 0, region);
XFixesDestroyRegion(display, region);
The ability to set ShapeInput
is "only" 5-6 years old so if you care about really crappy old versions of X11, you might be hosed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With