From 65501f0e467efa5e5b5ac01ef098971489b2b8c9 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Mon, 9 Mar 2020 11:09:25 +0000 Subject: tray: track SNI callbacks This removes any pending messages once the item is destroyed. Furthermore, this installs SNI event calbacks asynchronously in order to prevent sd-bus from bypassing pending messages. --- include/swaybar/tray/item.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/swaybar') diff --git a/include/swaybar/tray/item.h b/include/swaybar/tray/item.h index 5ffd8363..c02a5582 100644 --- a/include/swaybar/tray/item.h +++ b/include/swaybar/tray/item.h @@ -14,6 +14,15 @@ struct swaybar_pixmap { unsigned char pixels[]; }; +struct swaybar_sni_slot { + struct wl_list link; // swaybar_sni::slots + struct swaybar_sni *sni; + const char *prop; + const char *type; + void *dest; + sd_bus_slot *slot; +}; + struct swaybar_sni { // icon properties struct swaybar_tray *tray; @@ -37,9 +46,7 @@ struct swaybar_sni { char *menu; char *icon_theme_path; // non-standard KDE property - sd_bus_slot *new_icon_slot; - sd_bus_slot *new_attention_icon_slot; - sd_bus_slot *new_status_slot; + struct wl_list slots; // swaybar_sni_slot::link }; struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray); -- cgit v1.2.3-54-g00ecf