diff options
author | Ian Fan <ianfan0@gmail.com> | 2020-03-09 11:09:25 +0000 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-03-30 17:31:00 +0200 |
commit | 65501f0e467efa5e5b5ac01ef098971489b2b8c9 (patch) | |
tree | 950e0644894076b22a421ed50817409f782998a0 /swaybar/tray/watcher.c | |
parent | tray: tidy code (diff) | |
download | sway-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 'swaybar/tray/watcher.c')
-rw-r--r-- | swaybar/tray/watcher.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/swaybar/tray/watcher.c b/swaybar/tray/watcher.c index 951a0589..16afc27c 100644 --- a/swaybar/tray/watcher.c +++ b/swaybar/tray/watcher.c | |||
@@ -182,7 +182,13 @@ struct swaybar_watcher *create_watcher(char *protocol, sd_bus *bus) { | |||
182 | 182 | ||
183 | ret = sd_bus_request_name(bus, watcher->interface, 0); | 183 | ret = sd_bus_request_name(bus, watcher->interface, 0); |
184 | if (ret < 0) { | 184 | if (ret < 0) { |
185 | sway_log(SWAY_ERROR, "Failed to acquire service name: %s", strerror(-ret)); | 185 | if (-ret == EEXIST) { |
186 | sway_log(SWAY_DEBUG, "Failed to acquire service name '%s':" | ||
187 | "another tray is already running", watcher->interface); | ||
188 | } else { | ||
189 | sway_log(SWAY_ERROR, "Failed to acquire service name '%s': %s", | ||
190 | watcher->interface, strerror(-ret)); | ||
191 | } | ||
186 | goto error; | 192 | goto error; |
187 | } | 193 | } |
188 | 194 | ||