From 33cd7c261f61acbc25c3231a33efc6926247a937 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 3 Jan 2008 19:06:44 +0100 Subject: [PATCH] set widget->width to the right size(TM) --- widgets/netwmicon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/widgets/netwmicon.c b/widgets/netwmicon.c index 2b80fd6c..8e823f94 100644 --- a/widgets/netwmicon.c +++ b/widgets/netwmicon.c @@ -40,7 +40,10 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset, NetWMIcon *icon; if(!sel) + { + widget->width = 0; return 0; + } for(r = globalconf.rules; r; r = r->next) if(r->icon && client_match_rule(sel, r)) @@ -58,7 +61,10 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset, if(!(icon = ewmh_get_window_icon(sel->win))) + { + widget->width = 0; return 0; + } widget->width = ((double) widget->statusbar->height / (double) icon->height) * icon->width;