widget: optimize cache invalidation

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-08-06 14:24:54 +02:00
parent 6bbbf03c95
commit f28fac6107

View file

@ -235,15 +235,16 @@ widget_invalidate_bywidget(widget_t *widget)
for(statusbar = globalconf.screens[screen].statusbar;
statusbar;
statusbar = statusbar->next)
for(witer = statusbar->widgets; witer; witer = witer->next)
if(witer->widget == widget)
{
statusbar->need_update = true;
break;
}
if(!statusbar->need_update)
for(witer = statusbar->widgets; witer; witer = witer->next)
if(witer->widget == widget)
{
statusbar->need_update = true;
break;
}
for(c = globalconf.clients; c; c = c->next)
if(c->titlebar)
if(c->titlebar && !c->titlebar->need_update)
for(witer = c->titlebar->widgets; witer; witer = witer->next)
if(witer->widget == widget)
c->titlebar->need_update = true;