Skip to content

Commit

Permalink
Work around even more SNI noncompliance (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
serebit authored Feb 24, 2024
1 parent 9b775d6 commit 84269e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/panel/applets/tray/TrayItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ internal class TrayItem : Gtk.EventBox {
}

if (icon_name != null && icon_name.length > 0) {
if (icon_theme_path != null && !Gtk.IconTheme.get_default().has_icon(icon_name)) {
if (FileUtils.test(icon_name, FileTest.IS_REGULAR)) {
// needed for noncompliant apps that use absolute paths for icon names
var pixbuf = new Gdk.Pixbuf.from_file(icon_name);
if (pixbuf != null) {
pixbuf = pixbuf.scale_simple(target_icon_size, target_icon_size, Gdk.InterpType.BILINEAR);
icon.set_from_pixbuf(pixbuf);
}
} else if (icon_theme_path != null && !Gtk.IconTheme.get_default().has_icon(icon_name)) {
var icon_theme = new Gtk.IconTheme();
icon_theme.prepend_search_path(icon_theme_path);
try {
Expand Down

0 comments on commit 84269e2

Please sign in to comment.