summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2020-03-09 11:09:25 +0000
committerLibravatar Simon Ser <contact@emersion.fr>2020-03-30 17:31:00 +0200
commit65501f0e467efa5e5b5ac01ef098971489b2b8c9 (patch)
tree950e0644894076b22a421ed50817409f782998a0 /include
parenttray: tidy code (diff)
downloadsway-65501f0e467efa5e5b5ac01ef098971489b2b8c9.tar.gz
sway-65501f0e467efa5e5b5ac01ef098971489b2b8c9.tar.zst
sway-65501f0e467efa5e5b5ac01ef098971489b2b8c9.zip
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.
Diffstat (limited to 'include')
-rw-r--r--include/swaybar/tray/item.h13
1 files changed, 10 insertions, 3 deletions
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 {
14 unsigned char pixels[]; 14 unsigned char pixels[];
15}; 15};
16 16
17struct swaybar_sni_slot {
18 struct wl_list link; // swaybar_sni::slots
19 struct swaybar_sni *sni;
20 const char *prop;
21 const char *type;
22 void *dest;
23 sd_bus_slot *slot;
24};
25
17struct swaybar_sni { 26struct swaybar_sni {
18 // icon properties 27 // icon properties
19 struct swaybar_tray *tray; 28 struct swaybar_tray *tray;
@@ -37,9 +46,7 @@ struct swaybar_sni {
37 char *menu; 46 char *menu;
38 char *icon_theme_path; // non-standard KDE property 47 char *icon_theme_path; // non-standard KDE property
39 48
40 sd_bus_slot *new_icon_slot; 49 struct wl_list slots; // swaybar_sni_slot::link
41 sd_bus_slot *new_attention_icon_slot;
42 sd_bus_slot *new_status_slot;
43}; 50};
44 51
45struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray); 52struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray);