From b27208d9d1306be8d181778c3780034f3afc2ec6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 22 Jan 2008 17:52:12 +0100 Subject: [PATCH] don't draw if we do not have space too --- widgets/tasklist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/widgets/tasklist.c b/widgets/tasklist.c index eb22827d3..5e4b56667 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -57,15 +57,15 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used) int n = 0, i = 0, box_width = 0, icon_width = 0, box_width_rest = 0; NetWMIcon *icon; + if(used >= widget->statusbar->width) + return (widget->area.width = 0); + for(c = globalconf.clients; c; c = c->next) if(ISVISIBLE_ON_TB(c, widget->statusbar->screen, d->show_all)) n++; if(!n) - { - widget->area.width = 0; - return widget->area.width; - } + return (widget->area.width = 0); box_width = (widget->statusbar->width - used) / n; /* compute how many pixel we left empty */