diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-10-12 20:18:04 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-10-14 13:33:12 +0100 |
commit | 19f0bf38640f4da609782442c901366617aa27fa (patch) | |
tree | 0aa166b77546858f433237ff1533b7ea6b709feb /swaybar/render.c | |
parent | swaybar: only subscribe to required events (diff) | |
download | sway-19f0bf38640f4da609782442c901366617aa27fa.tar.gz sway-19f0bf38640f4da609782442c901366617aa27fa.tar.zst sway-19f0bf38640f4da609782442c901366617aa27fa.zip |
swaybar: add free_hotspots helper function
Diffstat (limited to 'swaybar/render.c')
-rw-r--r-- | swaybar/render.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/swaybar/render.c b/swaybar/render.c index dc31a5ea..2a06a79b 100644 --- a/swaybar/render.c +++ b/swaybar/render.c | |||
@@ -491,14 +491,7 @@ static const struct wl_callback_listener output_frame_listener = { | |||
491 | void render_frame(struct swaybar_output *output) { | 491 | void render_frame(struct swaybar_output *output) { |
492 | assert(output->surface != NULL); | 492 | assert(output->surface != NULL); |
493 | 493 | ||
494 | struct swaybar_hotspot *hotspot, *tmp; | 494 | free_hotspots(&output->hotspots); |
495 | wl_list_for_each_safe(hotspot, tmp, &output->hotspots, link) { | ||
496 | if (hotspot->destroy) { | ||
497 | hotspot->destroy(hotspot->data); | ||
498 | } | ||
499 | wl_list_remove(&hotspot->link); | ||
500 | free(hotspot); | ||
501 | } | ||
502 | 495 | ||
503 | cairo_surface_t *recorder = cairo_recording_surface_create( | 496 | cairo_surface_t *recorder = cairo_recording_surface_create( |
504 | CAIRO_CONTENT_COLOR_ALPHA, NULL); | 497 | CAIRO_CONTENT_COLOR_ALPHA, NULL); |