~steef/snixembed

703a9b3d3afdfc5652a07f138168416a06e3271e — Steef Hegeman 2 years ago 21e6aea
AppInd. "convention": accept paths for IconName

It is not intended for apps to set paths as icon name. Some do it
anyway, and some hosts accept it. snixembed now does so too.
1 files changed, 8 insertions(+), 0 deletions(-)

M src/proxyicon.vala
M src/proxyicon.vala => src/proxyicon.vala +8 -0
@@ 47,6 47,14 @@ class ProxyIcon : Object {
    void set_icon() {
        var name = item.icon_name;
        if (name != null && name != "") {
            /* Some apps wrongly set a filename for name, relying on this
             * undefined behavior. Since StatusIcon.set_from_file gives no
             * feedback, this check and race is about the best we can do. */
            if (name.contains("/") && FileUtils.test(name, FileTest.EXISTS)) {
                icon.set_from_file(name);
                return;
            }

            var theme = Gtk.IconTheme.get_for_screen(icon.screen);
            var path = item.icon_theme_path;
            if (path != null) {