X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fsystray%2Fsystraybar.c;h=e9b6c509b040b5a058f9e4772e2ca2c7e3907484;hb=367bf8f76227dea6e7e10e974967ae1d60cfe38e;hp=a210ba891af666fa7430fd93047bd34d923add5e;hpb=8abd6d423bffc9cd35928e1911c138163f7dbda9;p=chaz%2Ftint2 diff --git a/src/systray/systraybar.c b/src/systray/systraybar.c index a210ba8..e9b6c50 100644 --- a/src/systray/systraybar.c +++ b/src/systray/systraybar.c @@ -423,7 +423,7 @@ gboolean add_icon(Window id) // watch for the icon trying to resize itself! XSelectInput(server.dsp, traywin->tray_id, StructureNotifyMask); if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) { - traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportRawRectangles); + traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportNonEmpty); XCompositeRedirectWindow(server.dsp, traywin->id, CompositeRedirectManual); } @@ -498,9 +498,11 @@ void net_message(XClientMessageEvent *e) } } - -void systray_render_icon(TrayWindow* traywin) +void systray_render_icon_now(void* t) { + TrayWindow* traywin = t; + traywin->render_timeout = 0; + // good systray icons support 32 bit depth, but some icons are still 24 bit. // We create a heuristic mask for these icons, i.e. we get the rgb value in the top left corner, and // mask out all pixel with the same rgb value @@ -529,6 +531,16 @@ void systray_render_icon(TrayWindow* traywin) } XCopyArea(server.dsp, systray.area.pix.pmap, panel->main_win, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x, traywin->y); imlib_free_image_and_decache(); + + XDamageSubtract(server.dsp, traywin->damage, None, None); + XFlush(server.dsp); +} + +void systray_render_icon(TrayWindow* traywin) +{ + // wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms + if (traywin->render_timeout == 0) + traywin->render_timeout = add_timeout(50, 0, systray_render_icon_now, traywin); }