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.
This commit is contained in:
xdavidwu 2021-09-14 23:07:26 +08:00
parent 04092c7f54
commit 306d36315d
No known key found for this signature in database
GPG key ID: EF1E781EE6BE877E

View file

@ -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;