From 306d36315db149dbd3634c56cfb58a009b62dd8e Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Tue, 14 Sep 2021 23:07:26 +0800 Subject: [PATCH] swaybar: fix tray icon hotspot width to prevent overlapping We decrease x with padded_source_size, so we should also set hostspot according to it. output->height may be bigger than padded_source_size and thus may make it overlap with neighbors. --- swaybar/tray/item.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c index 1bc651910..e1c982063 100644 --- a/swaybar/tray/item.c +++ b/swaybar/tray/item.c @@ -520,7 +520,7 @@ uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x, struct swaybar_hotspot *hotspot = calloc(1, sizeof(struct swaybar_hotspot)); hotspot->x = *x; hotspot->y = 0; - hotspot->width = output->height; + hotspot->width = padded_surface_size; hotspot->height = output->height; hotspot->callback = icon_hotspot_callback; hotspot->destroy = free;