swaybar: fix tray icons rendering on scaled outputs

#6504 simplified rendering code by setting scale at cairo, but not the code
for rendering tray icons, making it draws at scale of expected size.
This fixes by resetting scale before drawing icons, and restoring it
afterward.
This commit is contained in:
xdavidwu 2021-09-14 14:34:39 +08:00
parent b7b96399e1
commit 04092c7f54
No known key found for this signature in database
GPG key ID: EF1E781EE6BE877E
2 changed files with 18 additions and 7 deletions

View file

@ -117,7 +117,7 @@ uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x) {
} // else display on all
if ((int) output->height*output->scale <= 2*config->tray_padding) {
return 2*config->tray_padding + 1;
return (2*config->tray_padding + 1) / output->scale;
}
uint32_t max_height = 0;