Skip to content
Advertisement

How to make an overlay which capture no events

I would like to draw some sort of window on top of all the other windows. For example, to display some debugging infos (like conky) or things like a timer.

The main thing is that I would like to able to continue using the other windows while using it (the events go through transparently).

I’ve tried doing it with pygtk, pyqt and others but can’t find a way to make it a real overlay with no event capture.

Is there some low-level x11 solution?

Advertisement

Answer

I think the Composite-extension-approach will not work when a compositing manager is running (and thus Composite’s overlay window is already used).

Since you explicitly mention “no event capture”:

The SHAPE extension allows to set some different shapes for a window. Version 1.1 of this extension added the “input” shape. Just setting this to an empty region should pretty much do what you want.

Some concrete example of exactly what I think you ask for can be found in Conky’s source code: http://sources.debian.net/src/conky/1.10.3-1/src/x11.cc/?hl=769#L764-L781

Edit: Since you said that you didn’t find anything in Gtk (well, PyGtk), here is the function that you need in Gtk: https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-input-shape-combine-region

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