summaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorManuel Stoeckl <code@mstoeckl.com>2026-02-13 20:09:57 -0500
committerSimon Ser <contact@emersion.fr>2026-02-14 18:16:11 +0100
commit473ebba206e4511f7300f9e32362cfff0eb7d908 (patch)
tree3ac0ac91961286a9d6f5bcd9abcbd307810f46cb /render.c
parent37f17319b4bec58cbbc4db15f6e92161f54650e7 (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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/render.c b/render.c
index 7be79b6..9d67241 100644
--- a/render.c
+++ b/render.c
@@ -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);