Window docker - turn any window into panel

Mike Cookson cook60020tmp at
Tue Mar 22 04:09:52 PDT 2011

The goal of this application is to turn any window into panel with possible autohiding (though currently i don't have yet option to disable autohiding :).
Should be very useful with detached toolbars and persistent dialogs, used as tool boxes.

Currently you have to specify window ID in command line. Run it with --help option to see options. Advanced rules, such as window class, name, type, etc may be added later.

Tested with dclock, xclock, xcalc, kcalc,kcolorchooser, fbrun, gmrun and glxgears under openbox, compiz, openbox, xfwm4 and metacity.
For now only first two don't cause problems. Under compiz problems with focus are noticed under kcolorchooser and kcalc. For kcalc - i can't enter digits by digital keys, but can delete entered digits with backspace.

There are some problems with visibility.
1. Regardless of what application is embedded, after first attempt window is not visible in gtk socket widget. I have to terminate docker and restart with same options, including window ID (currently it supports only such dumb rule - more rules have to be added later), and only after this step window is visible.
2. However, sometimes owner of embedded window may terminate self on attempt to embed its window, which seems to be destroyed, because gtk socket widget is also destroyed in this case by default.

KWin: Only problem 1 happens in all cases, without exceptions.
Problem 1: all
- Invisible after reparent to root: all

- no problems: fbrun, kcalc, kcolorchooser
- Problem 1:   gmrun, xclock, xcalc, glxgears
- Terminated:  dclock (however size of window is got correct)
- Invisible after reparent to root: all

- invisible after reparent to root: all with one exception - kcolorchooser is visible after first docking attempt for same window.

- Problem 1: all
- invisible after reparent to root: None
Note: after second releasing of same window strange thing begin - two cases follow each after other - first is when window is not visible, second - only frame is visible, without any contents, which however, can be managed by WM - e.g., closed.

*** For developers ***

Some of these bugs may be WM problems, i don't know, what are they. As developer, i'm newbie, so please be patient. Any help is welcomed.

The order of embedding is:
1. Call gtk_socket_add_id () to add window to socket widget.
2. Get gdk window object from socket in order to set widget size to size of window. Just to be safe (i noticed, that gtk_socket_add_id () should do this work).

When docker exits: there is gtk main loop quit callback "on_quit", which does the following work:
1. Get gdk window from socket, than root window, using gdk_screen_get_root_window()
2. Reparents embedded window into root window
Btw: It is reparented always with position 0,14, got from window, returned by gdk_window_foreign_new(), which is used before to embed window. Compiz places such windows regardless of reparenting placement hint.

More information about the xdg mailing list