diff options
| author | Manuel Stoeckl <code@mstoeckl.com> | 2026-02-13 20:09:57 -0500 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2026-02-14 18:16:11 +0100 |
| commit | 473ebba206e4511f7300f9e32362cfff0eb7d908 (patch) | |
| tree | 3ac0ac91961286a9d6f5bcd9abcbd307810f46cb /render.c | |
| parent | 37f17319b4bec58cbbc4db15f6e92161f54650e7 (diff) | |
Always set wl_buffer scale
This correctly handles the case in which the output scale and session
lock surface size change but the wl_buffer size to submit for the
output remains the same. The buffer scale still needs updating, even
though the wl_buffer contents have not changed.
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -91,7 +91,6 @@ void render(struct swaylock_surface *surface) { cairo_restore(cairo); cairo_identity_matrix(cairo); - wl_surface_set_buffer_scale(surface->surface, surface->scale); wl_surface_attach(surface->surface, buffer.buffer, 0, 0); wl_surface_damage_buffer(surface->surface, 0, 0, INT32_MAX, INT32_MAX); need_destroy = true; @@ -100,6 +99,9 @@ void render(struct swaylock_surface *surface) { surface->last_buffer_height = buffer_height; } + // It is possible for the surface scale to change even if the wl_buffer size hasn't + wl_surface_set_buffer_scale(surface->surface, surface->scale); + render_frame(surface); surface->dirty = false; surface->frame = wl_surface_frame(surface->surface); |
