systray: Prevent triggering concurrent updates for the same icon
This commit is contained in:
parent
1b4b0a8d8d
commit
b235f77f39
1 changed files with 6 additions and 2 deletions
|
@ -613,14 +613,18 @@ void systray_render_icon_now(void* t)
|
|||
}
|
||||
traywin->time_last_render.tv_sec = now.tv_sec;
|
||||
traywin->time_last_render.tv_nsec = now.tv_nsec;
|
||||
traywin->render_timeout = NULL;
|
||||
|
||||
if ( traywin->width == 0 || traywin->height == 0 ) {
|
||||
// reschedule rendering since the geometry information has not yet been processed (can happen on slow cpu)
|
||||
systray_render_icon(traywin);
|
||||
traywin->render_timeout = add_timeout(50, 0, systray_render_icon_now, traywin, &traywin->render_timeout);
|
||||
return;
|
||||
}
|
||||
|
||||
if (traywin->render_timeout) {
|
||||
stop_timeout(traywin->render_timeout);
|
||||
traywin->render_timeout = NULL;
|
||||
}
|
||||
|
||||
int empty = 1;
|
||||
XImage *ximage = XGetImage(server.dsp, traywin->tray_id, 0, 0, traywin->width, traywin->height, AllPlanes, XYPixmap);
|
||||
if (ximage) {
|
||||
|
|
Loading…
Reference in a new issue