diff --git a/src/systray/systraybar.c b/src/systray/systraybar.c index 4efca82..59d3df6 100644 --- a/src/systray/systraybar.c +++ b/src/systray/systraybar.c @@ -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) {