From: Andreas Fink Date: Thu, 31 Dec 2009 14:20:32 +0000 (+0000) Subject: *fix* clear tooltip window before redrawing X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=b7aaf2ac709f85602ef6152980a639fd3a8577e7;p=chaz%2Ftint2 *fix* clear tooltip window before redrawing *fix* all systray icons should be visible also in real transparency mode --- diff --git a/src/systray/systraybar.c b/src/systray/systraybar.c index 273d9bb..02ed1b4 100644 --- a/src/systray/systraybar.c +++ b/src/systray/systraybar.c @@ -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); diff --git a/src/tooltip/tooltip.c b/src/tooltip/tooltip.c index d606047..6c36625 100644 --- a/src/tooltip/tooltip.c +++ b/src/tooltip/tooltip.c @@ -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); }