From 09c14e4ea968641abfc7f8c0aba5649ef9987b89 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:52:33 +0100 Subject: [PATCH] Don't use missing image icon when noti provides invalid icon name. Fixes #350 --- src/functions.vala | 4 ---- src/notification/notification.vala | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/functions.vala b/src/functions.vala index 5918dc78..7ba94455 100644 --- a/src/functions.vala +++ b/src/functions.vala @@ -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); } } diff --git a/src/notification/notification.vala b/src/notification/notification.vala index 765c61e1..4e76f3f2 100644 --- a/src/notification/notification.vala +++ b/src/notification/notification.vala @@ -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) {