mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 12:35:41 +02:00
bar/wayland: explicitly refresh on scale changes
Just calling update_size() isn't enough, as that in itself doesn't trigger a redraw.
This commit is contained in:
parent
6bf077240c
commit
f426155e0b
1 changed files with 12 additions and 1 deletions
|
@ -378,6 +378,7 @@ output_done(void *data, struct wl_output *wl_output)
|
|||
}
|
||||
|
||||
static bool update_size(struct wayland_backend *backend);
|
||||
static void refresh(const struct bar *_bar);
|
||||
|
||||
static void
|
||||
output_scale(void *data, struct wl_output *wl_output, int32_t factor)
|
||||
|
@ -388,8 +389,13 @@ output_scale(void *data, struct wl_output *wl_output, int32_t factor)
|
|||
|
||||
mon->scale = factor;
|
||||
|
||||
if (mon->backend->monitor == mon)
|
||||
if (mon->backend->monitor == mon) {
|
||||
int old_scale = mon->backend->scale;
|
||||
update_size(mon->backend);
|
||||
|
||||
if (mon->backend->scale != old_scale)
|
||||
refresh(mon->backend->bar);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1054,7 +1060,12 @@ surface_enter(void *data, struct wl_surface *wl_surface,
|
|||
|
||||
if (backend->monitor != mon) {
|
||||
backend->monitor = mon;
|
||||
|
||||
int old_scale = backend->scale;
|
||||
update_size(backend);
|
||||
|
||||
if (backend->scale != old_scale)
|
||||
refresh(backend->bar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue