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

This commit is contained in:
Erik Reider 2023-12-07 20:52:33 +01:00
parent 5a23d5eeb5
commit 09c14e4ea9
2 changed files with 5 additions and 5 deletions

View File

@ -36,10 +36,6 @@ namespace SwayNotificationCenter {
} else if (Gtk.IconTheme.get_default ().has_icon (path)) {
// Try as a freedesktop.org-compliant icon theme
img.set_from_icon_name (path, Notification.icon_size);
} else {
img.set_from_icon_name (
"image-missing",
Notification.icon_size);
}
}

View File

@ -651,6 +651,8 @@ namespace SwayNotificationCenter {
}
private void set_icon () {
img.clear ();
var image_visibility = ConfigModel.instance.image_visibility;
if (image_visibility == ImageVisibility.NEVER) {
img.set_visible (false);
@ -682,7 +684,9 @@ namespace SwayNotificationCenter {
} else if (param.icon_data.is_initialized) {
Functions.set_image_data (param.icon_data, img,
notification_icon_size);
} else {
}
if (img.storage_type == Gtk.ImageType.EMPTY) {
// Get the app icon
Icon ? icon = null;
if (param.desktop_entry != null) {