swaybar: handle SNI signals better

This fixes a crash caused by callbacks not matching the right sender,
and frees old values later, before they are re-assigned.
This commit is contained in:
Ian Fan 2019-01-04 11:57:18 +00:00
parent b666fc76a6
commit d093c3ac55
2 changed files with 65 additions and 33 deletions

View file

@ -35,6 +35,10 @@ struct swaybar_sni {
bool item_is_menu;
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 swaybar_sni *create_sni(char *id, struct swaybar_tray *tray);