]> Dogcows Code - chaz/tint2/blobdiff - src/systray/systraybar.c
*fix* clear tooltip window before redrawing
[chaz/tint2] / src / systray / systraybar.c
index 85431967d8128266aa48c9757859863bf1ee8d34..02ed1b4ed20440b212fe422550be4399a363b210 100644 (file)
@@ -214,6 +214,8 @@ void start_net()
        // 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) {
@@ -299,6 +301,15 @@ gboolean add_icon(Window id)
 
        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);
This page took 0.022128 seconds and 4 git commands to generate.