]> Dogcows Code - chaz/tint2/commitdiff
*fix* clear tooltip window before redrawing
authorAndreas Fink <andreas.fink85@googlemail.com>
Thu, 31 Dec 2009 14:20:32 +0000 (14:20 +0000)
committerAndreas Fink <andreas.fink85@googlemail.com>
Thu, 31 Dec 2009 14:20:32 +0000 (14:20 +0000)
*fix* all systray icons should be visible also in real transparency mode

src/systray/systraybar.c
src/tooltip/tooltip.c

index 273d9bb8e2d9879a05c7582ae48ad384d55f96e5..02ed1b4ed20440b212fe422550be4399a363b210 100644 (file)
@@ -301,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);
index d606047f2d85b4270a2b89db0e61f8a45baa0d93..6c3662542ffe436b86ef2aba933bc2aa3d33cd76 100644 (file)
@@ -217,6 +217,7 @@ void tooltip_update()
        Color bc = g_tooltip.background_color;
        Border b = g_tooltip.border;
        if (real_transparency) {
+               clear_pixmap(g_tooltip.window, 0, 0, width, height);
                draw_rect(c, b.width, b.width, width-2*b.width, height-2*b.width, b.rounded-b.width/1.571);
                cairo_set_source_rgba(c, bc.color[0], bc.color[1], bc.color[2], bc.alpha);
        }
This page took 0.023784 seconds and 4 git commands to generate.