aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 7303e70f..2d848bfa 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -115,6 +115,10 @@ static enum hotspot_event_handling block_hotspot_callback(struct swaybar_output
115 return i3bar_block_send_click(status, block, x, y, button); 115 return i3bar_block_send_click(status, block, x, y, button);
116} 116}
117 117
118static void i3bar_block_unref_callback(void *data) {
119 i3bar_block_unref(data);
120}
121
118static uint32_t render_status_block(cairo_t *cairo, 122static uint32_t render_status_block(cairo_t *cairo,
119 struct swaybar_config *config, struct swaybar_output *output, 123 struct swaybar_config *config, struct swaybar_output *output,
120 struct i3bar_block *block, double *x, 124 struct i3bar_block *block, double *x,
@@ -179,8 +183,9 @@ static uint32_t render_status_block(cairo_t *cairo,
179 hotspot->width = width; 183 hotspot->width = width;
180 hotspot->height = height; 184 hotspot->height = height;
181 hotspot->callback = block_hotspot_callback; 185 hotspot->callback = block_hotspot_callback;
182 hotspot->destroy = NULL; 186 hotspot->destroy = i3bar_block_unref_callback;
183 hotspot->data = block; 187 hotspot->data = block;
188 block->ref_count++;
184 wl_list_insert(&output->hotspots, &hotspot->link); 189 wl_list_insert(&output->hotspots, &hotspot->link);
185 190
186 double pos = *x; 191 double pos = *x;