From 473ebba206e4511f7300f9e32362cfff0eb7d908 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Fri, 13 Feb 2026 20:09:57 -0500 Subject: 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. --- render.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3