naughty: Display the notification with invalid icons.

They previously caused an error.
This commit is contained in:
Emmanuel Lepage Vallee 2019-01-04 00:05:05 -05:00
parent 29cef2d615
commit bfda6f64bb
1 changed files with 5 additions and 1 deletions

View File

@ -457,7 +457,8 @@ function naughty.default_notification_handler(notification, args)
end
-- is the icon file readable?
icon = surface.load_uncached(icon)
local had_icon = type(icon) == "string"
icon = surface.load_uncached_silently(icon)
-- if we have an icon, use it
if icon then
@ -487,6 +488,9 @@ function naughty.default_notification_handler(notification, args)
end
iconbox:set_resize(false)
iconbox:set_image(icon)
elseif had_icon then
require("gears.debug").print_warning("Naughty: failed to load icon "..
(args.icon or preset.icon).. "(title: "..title..")")
end
end
notification.iconbox = iconbox