From 3357af7d6b2040e7a52b5726318c5c56e8d34831 Mon Sep 17 00:00:00 2001 From: Steef Hegeman Date: Mon, 8 Jun 2020 00:12:43 +0200 Subject: [PATCH] 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). --- src/statusnotifieritem.vala | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/statusnotifieritem.vala b/src/statusnotifieritem.vala index 61e6469..8fac6d1 100644 --- a/src/statusnotifieritem.vala +++ b/src/statusnotifieritem.vala @@ -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 */ } }); } } -- 2.45.2