From f28fac6107e8cc0551f517efe2e917dda35f2c70 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 6 Aug 2008 14:24:54 +0200 Subject: [PATCH] widget: optimize cache invalidation Signed-off-by: Julien Danjou --- widget.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/widget.c b/widget.c index 4ce13fafd..a2ab58312 100644 --- a/widget.c +++ b/widget.c @@ -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;