Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    2

    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
    1. 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.
    2. 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:
    1. Where can I find detailed documentation on these different window types?
    2. Will the behaviour of these types be consistent across different X configurations
      (window managers, desktop environments, ... )?
    3. 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?
    4. Which entity (window manager, desktop environment, X server, ...) determines how
      input events are marshalled along the window hierarchy?
    5. How can one find out, programmatically, whether a compositing window manager is
      installed and whether it supports certain functionality?
    6. Any other tips/hints/pointers ... ?

    Thank you very much for any help you can give.

  2. #2
    Just Joined!
    Join Date
    Oct 2007
    Posts
    14
    hi jacque

    Did you find any document relevant to the use case that u described.

    Thanks
    Raja

  3. #3
    Just Joined!
    Join Date
    Jul 2008
    Posts
    2
    Quote Originally Posted by rajainnov View Post
    hi jacque

    Did you find any document relevant to the use case that u described.

    Thanks
    Raja
    Yes, sort of. I did some digging and found a lot of info. Depends on what you're after. Basically, there seems to be no support for this sort of thing in X because there is no use case. The XDnD protocol is entirely different to the Java or Windows protocols, and it leaves everything up to the developer. If you want a dnd enabled app in X, you need to implement all the functionality yourself, or else use a toolkit.

    The XDnD protocol specifies how "drag over" and "drag under" effects are communicated - by setting (and I think listening for) specific properties on specific windows (I forget the details). The window manager therefore has nothing to do with dnd, apart from drawing the funky transparent drag image (that you have to create). It's all up to the app programmer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •