]> Dogcows Code - chaz/tint2/blobdiff - src/systray/systraybar.c
*fix* issue 217
[chaz/tint2] / src / systray / systraybar.c
index 1c1eb60e94340224f161393b57cd3ba59309993d..6db579783109b64992ce337c64381909ad5e928c 100644 (file)
@@ -522,9 +522,13 @@ void systray_render_icon_now(void* t)
        Pixmap tmp_pmap = XCreatePixmap(server.dsp, server.root_win, traywin->width, traywin->height, server.depth);
        XRenderPictFormat* f;
        if (traywin->depth == 24)
-               f = XRenderFindVisualFormat(server.dsp, DefaultVisual(server.dsp, 0));
-       else
-               f = XRenderFindVisualFormat(server.dsp, server.visual);
+               f = XRenderFindStandardFormat(server.dsp, PictStandardRGB24);
+       else if (traywin->depth == 32)
+               f = XRenderFindStandardFormat(server.dsp, PictStandardARGB32);
+       else {
+               printf("Strange tray icon found...\n");
+               return;
+       }
        Picture pict_image = XRenderCreatePicture(server.dsp, traywin->tray_id, f, 0, 0);
        Picture pict_drawable = XRenderCreatePicture(server.dsp, tmp_pmap, XRenderFindVisualFormat(server.dsp, server.visual), 0, 0);
        XRenderComposite(server.dsp, PictOpSrc, pict_image, None, pict_drawable, 0, 0, 0, 0, 0, 0, traywin->width, traywin->height);
@@ -540,7 +544,7 @@ void systray_render_icon_now(void* t)
        imlib_context_set_image(image);
        imlib_image_set_has_alpha(1);
        DATA32* data = imlib_image_get_data();
-       if (traywin->depth == 24 && server.depth != 24) {
+       if (traywin->depth == 24) {
                createHeuristicMask(data, traywin->width, traywin->height);
        }
        if (systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0)
This page took 0.020009 seconds and 4 git commands to generate.