Commit 09c14e4e authored by Erik Reider's avatar Erik Reider

Don't use missing image icon when noti provides invalid icon name. Fixes #350

parent 5a23d5ee
...@@ -36,10 +36,6 @@ namespace SwayNotificationCenter { ...@@ -36,10 +36,6 @@ namespace SwayNotificationCenter {
} else if (Gtk.IconTheme.get_default ().has_icon (path)) { } else if (Gtk.IconTheme.get_default ().has_icon (path)) {
// Try as a freedesktop.org-compliant icon theme // Try as a freedesktop.org-compliant icon theme
img.set_from_icon_name (path, Notification.icon_size); img.set_from_icon_name (path, Notification.icon_size);
} else {
img.set_from_icon_name (
"image-missing",
Notification.icon_size);
} }
} }
......
...@@ -651,6 +651,8 @@ namespace SwayNotificationCenter { ...@@ -651,6 +651,8 @@ namespace SwayNotificationCenter {
} }
private void set_icon () { private void set_icon () {
img.clear ();
var image_visibility = ConfigModel.instance.image_visibility; var image_visibility = ConfigModel.instance.image_visibility;
if (image_visibility == ImageVisibility.NEVER) { if (image_visibility == ImageVisibility.NEVER) {
img.set_visible (false); img.set_visible (false);
...@@ -682,7 +684,9 @@ namespace SwayNotificationCenter { ...@@ -682,7 +684,9 @@ namespace SwayNotificationCenter {
} else if (param.icon_data.is_initialized) { } else if (param.icon_data.is_initialized) {
Functions.set_image_data (param.icon_data, img, Functions.set_image_data (param.icon_data, img,
notification_icon_size); notification_icon_size);
} else { }
if (img.storage_type == Gtk.ImageType.EMPTY) {
// Get the app icon // Get the app icon
Icon ? icon = null; Icon ? icon = null;
if (param.desktop_entry != null) { if (param.desktop_entry != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment