max: Fix issue when there is no client icon

This commit is contained in:
Emmanuel Lepage Vallee 2015-12-26 06:56:34 -05:00
parent fb29fa2801
commit cd7ce63e80
1 changed files with 5 additions and 0 deletions

View File

@ -178,6 +178,11 @@ local function client_icon(c,width,height)
-- Add icon on top, "solve" the black window issue
local icon = surface(c.icon)
if not icon then
return img
end
local w,h = icon:get_width(),icon:get_height()
local aspect,aspect_h = width / w,(height) / h
if aspect > aspect_h then aspect = aspect_h end