aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Lee <cyrus296@gmail.com>2017-10-27 13:17:54 -0600
committerCalvin Lee <cyrus296@gmail.com>2017-12-29 12:11:51 -0700
commit3137f32711b3df2a650b4a686a601e3bf11f930a (patch)
treea45f3a9c6aa9083bcb832a6915cbdc266bbfbd58
parent210e5bb893598f2bcf9011e29d22146850969b1e (diff)
Allow correct item to get icon updates
-rw-r--r--swaybar/tray/tray.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/swaybar/tray/tray.c b/swaybar/tray/tray.c
index a95b29fd..e926faae 100644
--- a/swaybar/tray/tray.c
+++ b/swaybar/tray/tray.c
@@ -276,11 +276,17 @@ static DBusHandlerResult signal_handler(DBusConnection *connection,
"NewIcon") || dbus_message_is_signal(message,
"org.kde.StatusNotifierItem", "NewIcon")) {
const char *name;
+ const char *obj_path;
int index;
struct StatusNotifierItem *item;
name = dbus_message_get_sender(message);
- if ((index = list_seq_find(tray->items, sni_uniq_cmp, name)) != -1) {
+ obj_path = dbus_message_get_path(message);
+ struct ObjName obj_name = {
+ obj_path,
+ name,
+ };
+ if ((index = list_seq_find(tray->items, sni_obj_name_cmp, &obj_name)) != -1) {
item = tray->items->items[index];
sway_log(L_INFO, "NewIcon signal from item %s", item->name);
get_icon(item);