mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +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 bool update_size(struct wayland_backend *backend);
|
||||||
|
static void refresh(const struct bar *_bar);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
output_scale(void *data, struct wl_output *wl_output, int32_t factor)
|
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;
|
mon->scale = factor;
|
||||||
|
|
||||||
if (mon->backend->monitor == mon)
|
if (mon->backend->monitor == mon) {
|
||||||
|
int old_scale = mon->backend->scale;
|
||||||
update_size(mon->backend);
|
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) {
|
if (backend->monitor != mon) {
|
||||||
backend->monitor = mon;
|
backend->monitor = mon;
|
||||||
|
|
||||||
|
int old_scale = backend->scale;
|
||||||
update_size(backend);
|
update_size(backend);
|
||||||
|
|
||||||
|
if (backend->scale != old_scale)
|
||||||
|
refresh(backend->bar);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue