Visually-transparent & Input-transparent Windows
Hi all
I'm a Java programmer who's rather new to Linux. I'm working on some code where I need to create a window similar to the drag images used during drag and drop on Windows 2000 or Mac OS. In other words, I need to create a window which
- Is visually translucent/transparent. This is the usual alpha blending that composes a foreground image with a background image, while allowing the background image to be visible "through" the foreground image.
- Is transparent to mouse events, in other words the window accepts no mouse events and all such event are passed through to whatever lies underneath.
I know how to do this rather painlessly in Windows (using WS_EX_LAYERED and WS_EX_TRANSPARENT). But I'm really battling to even get started in Linux, because I can't seem to find any documentation! As a complete Linux novice, I admit I'm not quite sure where to look. I have found two leads so far. The first is the window property
_NET_WM_WINDOW_OPACITY
which is set on a window with XChangeProperty. I cannot find any hard documentation on what this actually does - all I know is it "makes the window translucent if there is a compositing window manager installed". The second lead is
_NET_WM_WINDOW_TYPE
which is also changed with XChangeProperty. Here things get even more vague, since there are (at least?) 8 window "TYPES" namely
Code:
_NET_WM_WINDOW_TYPE_DESKTOP
_NET_WM_WINDOW_TYPE_DOCK
_NET_WM_WINDOW_TYPE_TOOLBAR
_NET_WM_WINDOW_TYPE_MENU
_NET_WM_WINDOW_TYPE_UTILITY
_NET_WM_WINDOW_TYPE_SPLASH
_NET_WM_WINDOW_TYPE_DIALOG
_NET_WM_WINDOW_TYPE_NORMAL
and the correspoding descriptions from standards.freedesktop.org raise more questions than they answer (see the description of _SPLASH for example). How do these window types affect mouse actions? Do any of them have the mouse transparency I seek?
What I am really thirsting after is something like the MSDN which simply lays down the
law and describes what happens, but I suspect that is not possible. I have a number of
questions, but they all boil down to the same thing:
- Where can I find detailed documentation on these different window types?
- Will the behaviour of these types be consistent across different X configurations
(window managers, desktop environments, ... )? - Do any of these types have "mouse transparency"? If not, where else can I go looking
for ways to make a window transparent to mouse events, ie. pass all mouse events through to whatever lies underneath? - Which entity (window manager, desktop environment, X server, ...) determines how
input events are marshalled along the window hierarchy? - How can one find out, programmatically, whether a compositing window manager is
installed and whether it supports certain functionality? - Any other tips/hints/pointers ... ?
Thank you very much for any help you can give.