Difference between revisions of "Development/Architecture/KDE3/System Tray Docking"

Jump to: navigation, search
(port http://developer.kde.org/documentation/library/kdeqt/kde3arch/protocols-docking.html)
 
m (Text replace - "</code>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
application, similar to a taskbar button, but consumes less screen
 
application, similar to a taskbar button, but consumes less screen
 
space.
 
space.
 
  
 
This page contains just the raw protocol description. More
 
This page contains just the raw protocol description. More
Line 29: Line 28:
 
The following code can be used to declare a window a tray window:
 
The following code can be used to declare a window a tray window:
  
<code cppqt3>
+
<syntaxhighlight lang="cpp-qt">
 
/** Prototypes:
 
/** Prototypes:
 
     Display dpy;
 
     Display dpy;
Line 39: Line 38:
 
                 XA_WINDOW, 32, PropModeReplace,
 
                 XA_WINDOW, 32, PropModeReplace,
 
                 (unsigned char *)&amp;forWin, 1);
 
                 (unsigned char *)&amp;forWin, 1);
</code>
+
</syntaxhighlight>
  
 
When the application maps the window with <tt>XMapWindow()</tt>,
 
When the application maps the window with <tt>XMapWindow()</tt>,
Line 45: Line 44:
 
<tt>XUnmapWindow()</tt> or <tt>XDestroyWindow()</tt>.
 
<tt>XUnmapWindow()</tt> or <tt>XDestroyWindow()</tt>.
  
== From the windowmanager's point of view ==
+
== From the windowmanager's point of view ==
  
 
TODO (once it is done)
 
TODO (once it is done)
 
{{improve}}
 
{{improve}}
  
== From the docking-container's point of view ==
+
== From the docking-container's point of view ==
  
 
TODO (once it is done)
 
TODO (once it is done)
Line 56: Line 55:
  
 
''Initial Author:'' [mailto:ettrich@kde.org Matthias Ettrich]
 
''Initial Author:'' [mailto:ettrich@kde.org Matthias Ettrich]
 +
 +
[[Category:KDE3]]
 +
[[Category:Architecture]]

Latest revision as of 21:49, 29 June 2011

KDE Architecture - System Tray Docking Protocol

Contents

[edit] 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 Components/SystemTrayDocking of this architecture overview.

[edit] 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 *)&amp;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().

[edit] From the windowmanager's point of view

TODO (once it is done)

noframe
 
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


[edit] From the docking-container's point of view

TODO (once it is done)


Initial Author: Matthias Ettrich


This page was last modified on 29 June 2011, at 21:49. This page has been accessed 3,780 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal