diff options
author | 2017-11-15 13:16:21 -0700 | |
---|---|---|
committer | 2017-12-29 12:11:51 -0700 | |
commit | 13b81f9fb91ee20a41ccdd955c2539d46ef6b6e1 (patch) | |
tree | 675e1fbd1e6500633c01e418a0b055cb3fe8d1db /swaybar/tray/tray.c | |
parent | Add `dbus_get_prop_async` utility (diff) | |
download | sway-13b81f9fb91ee20a41ccdd955c2539d46ef6b6e1.tar.gz sway-13b81f9fb91ee20a41ccdd955c2539d46ef6b6e1.tar.zst sway-13b81f9fb91ee20a41ccdd955c2539d46ef6b6e1.zip |
Fix `get_icon`
Property reply functions are now notified if there was an error with the
property instead of silent failure. Also issues in `get_item` were
resolved.
Diffstat (limited to 'swaybar/tray/tray.c')
-rw-r--r-- | swaybar/tray/tray.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/swaybar/tray/tray.c b/swaybar/tray/tray.c index 89e7c3e2..3c5492f7 100644 --- a/swaybar/tray/tray.c +++ b/swaybar/tray/tray.c | |||
@@ -38,7 +38,10 @@ static void register_host(char *name) { | |||
38 | dbus_message_unref(message); | 38 | dbus_message_unref(message); |
39 | } | 39 | } |
40 | 40 | ||
41 | static void get_items_reply(DBusMessageIter *iter, void *_data) { | 41 | static void get_items_reply(DBusMessageIter *iter, void *_data, enum property_status status) { |
42 | if (status != PROP_EXISTS) { | ||
43 | return; | ||
44 | } | ||
42 | DBusMessageIter array; | 45 | DBusMessageIter array; |
43 | 46 | ||
44 | // O(n) function, could be faster dynamically reading values | 47 | // O(n) function, could be faster dynamically reading values |
@@ -60,7 +63,10 @@ static void get_items_reply(DBusMessageIter *iter, void *_data) { | |||
60 | } | 63 | } |
61 | } | 64 | } |
62 | } | 65 | } |
63 | static void get_obj_items_reply(DBusMessageIter *iter, void *_data) { | 66 | static void get_obj_items_reply(DBusMessageIter *iter, void *_data, enum property_status status) { |
67 | if (status != PROP_EXISTS) { | ||
68 | return; | ||
69 | } | ||
64 | DBusMessageIter array; | 70 | DBusMessageIter array; |
65 | DBusMessageIter dstruct; | 71 | DBusMessageIter dstruct; |
66 | 72 | ||