mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
swaybar: do not retry search for tray icons
In case a tray icon cannot be found or does not have a desirable size, swaybar retries the search again and again, which increases load on disk and CPU. This commit solves it by storing target_size for each icon, so that swaybar does not search for an icon of some size if it already tried to. Fixes #3789.
This commit is contained in:
parent
a5b6f40937
commit
fa0abaf7cf
3 changed files with 62 additions and 52 deletions
|
|
@ -124,7 +124,9 @@ uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x) {
|
|||
struct swaybar_tray *tray = output->bar->tray;
|
||||
for (int i = 0; i < tray->items->length; ++i) {
|
||||
uint32_t h = render_sni(cairo, output, x, tray->items->items[i]);
|
||||
max_height = h > max_height ? h : max_height;
|
||||
if (h > max_height) {
|
||||
max_height = h;
|
||||
}
|
||||
}
|
||||
|
||||
return max_height;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue