On Wed, Apr 14, 2004 at 03:36:15AM +0200, Martin Stubenschrott wrote:
> hmm, but if I set the winprop for all apps which set this
> _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR style bit, to "target = dock", the system
> tray icons work perfectly, so I don't see the reason to implement the full
> XEMBED specification.
>
> Why not just check for this style hint, and if present move the window to the
> dock?
OK, here's a patch for the latest ion-2 (ion-2-20040407).
I haven't tested it beyond checking that it compiles, but it _should_ work.
I don't have KDE or GNOME installed on my system, so I can't test it.
So, if some kind soul would be kind enough to check whether it works and
email me or the list I'll make any necessary changes. Hopefully Tuomo can
merge it into the latest subversion snapshot once it works.
Regards,
--
Tom
--- ion-2-20040407/dock/dock.c 2004-02-16 18:58:47.000000000 +0100
+++ ion-2/dock/dock.c 2004-04-14 23:59:43.224438168 +0200
@@ -1205,6 +1205,31 @@
}
/* }}} */
+ /* Fourth, inspect the _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR property {{{ */
+ if(!is_dockapp){
+ static Atom atom__kde_net_wm_system_tray_window_for=None;
+ Atom actual_type=None;
+ int actual_format;
+ unsigned long nitems;
+ unsigned long bytes_after;
+ unsigned char *prop;
+
+ if(atom__kde_net_wm_system_tray_window_for==None){
+ atom__kde_net_wm_system_tray_window_for=XInternAtom(wglobal.dpy,
+
"_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR",
+ False);
+ }
+ XGetWindowProperty(wglobal.dpy, cwin->win,
+ atom__kde_net_wm_system_tray_window_for, 0,
+ sizeof(Atom), False, AnyPropertyType, &actual_type,
+ &actual_format, &nitems, &bytes_after, &prop);
+ if(actual_type!=None){
+ is_dockapp=TRUE;
+ }
+ XFree(prop);
+ }
+ /* }}} */
+
return is_dockapp;
}