System Tray Docking Protocol (KDE3 Architecture)

From Trinity Desktop Project Wiki
Revision as of 16:41, 21 April 2022 by Blu256 (talk | contribs) (+ KDE3)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Legacy KDE.png
This page contains information relevant to KDE 3.x or older versions.
This page contains archived content from various sources pertaining to KDE 3.x (maybe outdated and/or partly useful) which should probably be updated. Please regard information in this page with extra caution.

The KDE System Tray Docking Protocol

A tray window is a small window (typically 24x24 pixel) that docks into the system tray in the desktop panel. It usually displays an icon or an animated icon there. The icon serves as representative for the application, similar to a taskbar button, but consumes less screen space.

This page contains just the raw protocol description. More information on the system tray itself and how to use it with KDE applications can be found in the section "Docking Into the Panel's System Tray" of this architecture overview.

From the application's point of view

For the application, a tray window is just another toplevel window with one special property defined. The property is called _KDE_NET_SYSTEM_TRAY_WINDOW_FOR and is of type XA_WINDOW, format 32.

The pure existence of this property indicates that the window manager should treat this window as a tray window. The property value may further define the tray window's main window, i.e. the window the tray window is representing.

The following code can be used to declare a window a tray window:

/** Prototypes:
    Display dpy;
    Window trayWin, forWin;
*/
Atom kde_net_wm_system_tray_window_for =
  XInternAtom( dpy, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False);
XChangeProperty( dpy, trayWin, kde_net_wm_system_tray_window_for,
                 XA_WINDOW, 32, PropModeReplace,
                 (unsigned char *)&forWin, 1);

When the application maps the window with XMapWindow(), the window will dock into a system tray if possible. Undocking is done with either XUnmapWindow() or XDestroyWindow().

From the windowmanager's point of view

TODO (once it is done)

From the docking-container's point of view

TODO (once it is done)


Initial Author: Matthias Ettrich