Skip to content

Commit

Permalink
Don't use missing image icon when noti provides invalid icon name. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikReider committed Dec 7, 2023
1 parent 5a23d5e commit 09c14e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/functions.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/notification/notification.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 09c14e4

Please sign in to comment.