all repos — tint2 @ 35ace40a05410dac22fbdd825195d773115cf670

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

*add* render finitely often systray icons (at most every 50 ms)


git-svn-id: http://tint2.googlecode.com/svn/trunk@324 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
Andreas.Fink85 Andreas.Fink85@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

35ace40a05410dac22fbdd825195d773115cf670

parent

349cb2f0231be23947ff8a877abbb1b90917ed84

3 files changed, 18 insertions(+), 3 deletions(-)

jump to
M src/systray/systraybar.csrc/systray/systraybar.c

@@ -498,9 +498,10 @@ break;

} } +void systray_render_icon_now(TrayWindow* traywin) +{ + traywin->render_timeout = 0; -void systray_render_icon(TrayWindow* traywin) -{ // 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 +530,15 @@ render_image(systray.area.pix.pmap, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height);

} 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(); + + 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); }

@@ -544,4 +554,7 @@ systray_render_icon(traywin);

else XClearArea(server.dsp, traywin->id, 0, 0, traywin->width, traywin->height, True); } +// +// if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) +// XFlush(server.dsp); }
M src/systray/systraybar.hsrc/systray/systraybar.h

@@ -12,6 +12,7 @@ #define SYSTRAYBAR_H

#include "common.h" #include "area.h" +#include "timer.h" #include <X11/extensions/Xdamage.h> // XEMBED messages

@@ -40,6 +41,7 @@ // TODO: manage icon's show/hide

int hide; int depth; Damage damage; + const struct timeout* render_timeout; } TrayWindow;
M src/tint.csrc/tint.c

@@ -855,7 +855,7 @@ GSList *l;

XDamageNotifyEvent* de = (XDamageNotifyEvent*)&e; for (l = systray.list_icons; l ; l = l->next) { traywin = (TrayWindow*)l->data; - if ( traywin->id == de->drawable ) { + if ( traywin->id == de->drawable && !de->more ) { systray_render_icon(traywin); break; }