draw nothing is icon is invalid

This commit is contained in:
Julien Danjou 2008-01-23 19:13:49 +01:00
parent 7ad43fe713
commit e0a12f9e58
1 changed files with 9 additions and 6 deletions

View File

@ -100,12 +100,15 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
if((r = rule_matching_client(c)) && r->icon)
{
area = draw_get_image_size(r->icon);
icon_width = ((double) widget->statusbar->height / (double) area.height) * area.width;
draw_image(ctx,
widget->area.x + box_width * i,
widget->area.y,
widget->statusbar->height,
r->icon);
if(area.width > 0 && area.height > 0)
{
icon_width = ((double) widget->statusbar->height / (double) area.height) * area.width;
draw_image(ctx,
widget->area.x + box_width * i,
widget->area.y,
widget->statusbar->height,
r->icon);
}
}
if(!icon_width && (icon = ewmh_get_window_icon(c->win)))