// Vertical panel will draw the systray horizontal.
int orient = 0;
XChangeProperty(server.dsp, net_sel_win, server.atom._NET_SYSTEM_TRAY_ORIENTATION, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &orient, 1);
+ VisualID vid = XVisualIDFromVisual(server.visual);
+ XChangeProperty(server.dsp, net_sel_win, XInternAtom(server.dsp, "_NET_SYSTEM_TRAY_VISUAL", False), XA_VISUALID, 32, PropModeReplace, (unsigned char*)&vid, 1);
XSetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN, net_sel_win, CurrentTime);
if (XGetSelectionOwner(server.dsp, server.atom._NET_SYSTEM_TRAY_SCREEN) != net_sel_win) {
error = FALSE;
old = XSetErrorHandler(window_error_handler);
+ XWindowAttributes attr;
+ XGetWindowAttributes(server.dsp, id, &attr);
+ if ( attr.depth != server.depth ) {
+ XSetWindowAttributes a;
+ a.background_pixmap = None; // set to none, otherwise XReparentWindow fails...
+ a.background_pixel = 0; // set background pixel to 0. Looks ugly, but at least the icon appears
+ // TODO: maybe the XShape extension can be used, to clip the icon
+ XChangeWindowAttributes(server.dsp, id, CWBackPixmap|CWBackPixel, &a);
+ }
XReparentWindow(server.dsp, id, panel->main_win, 0, 0);
XSync(server.dsp, False);
XSetErrorHandler(old);
// remove from our list
systray.list_icons = g_slist_remove(systray.list_icons, traywin);
- g_free(traywin);
systray.area.resize = 1;
systray.area.redraw = 1;
//printf("remove_icon id %lx, %d\n", traywin->id);
XReparentWindow(server.dsp, traywin->id, server.root_win, 0, 0);
XSync(server.dsp, False);
XSetErrorHandler(old);
+ g_free(traywin);
// changed in systray force resize on panel
Panel *panel = systray.area.panel;