~steef/snixembed

3357af7d6b2040e7a52b5726318c5c56e8d34831 — Steef Hegeman 3 years ago edd4d6e
async: track IconThemePath updates again

Fixes ~steef/snixembed#5 as far as we can (old node versions still send
nonexisting IconThemePaths sometimes, so icons may still break).
1 files changed, 12 insertions(+), 7 deletions(-)

M src/statusnotifieritem.vala
M src/statusnotifieritem.vala => src/statusnotifieritem.vala +12 -7
@@ 38,6 38,9 @@ interface StatusNotifierItem : Object {
    public virtual signal void new_icon() {
        update_cache("IconName", "icon-name");
        update_cache("IconPixmap", "icon-pixmap");

        // AppIndicator only
        update_cache("IconThemePath", "icon-theme-path");
    }

    public virtual signal void new_tool_tip() {


@@ 58,14 61,16 @@ interface StatusNotifierItem : Object {

        var par = new Variant("(ss)", me.get_interface_name(), property);
        me.call.begin("org.freedesktop.DBus.Properties.Get", par, 0, -1, null, (obj, result) => {
            Variant res, v;
            res = me.call.end(result);
            res.get("(v)", out v);
            try {
                Variant res, v;
                res = me.call.end(result);
                res.get("(v)", out v);

            if (v != me.get_cached_property(property)) {
                me.set_cached_property(property, v);
                (me as StatusNotifierItem).changed(name);
            }
                if (v != me.get_cached_property(property)) {
                    me.set_cached_property(property, v);
                    (me as StatusNotifierItem).changed(name);
                }
            } catch (DBusError.INVALID_ARGS e) { /* Ignore properties that don't exist */ }
        });
    }
}