Fix indicator buffer not resizing after display powers off

This commit is contained in:
Michael Swiger 2021-06-27 20:46:01 -07:00 committed by Simon Ser
parent 9754241080
commit 4088033ff6

View File

@ -310,17 +310,17 @@ void render_frame(struct swaylock_surface *surface) {
new_width = extents.width + 2 * box_padding; new_width = extents.width + 2 * box_padding;
} }
} }
}
// Ensure buffer size is multiple of buffer scale - required by protocol // Ensure buffer size is multiple of buffer scale - required by protocol
new_height += surface->scale - (new_height % surface->scale); new_height += surface->scale - (new_height % surface->scale);
new_width += surface->scale - (new_width % surface->scale); new_width += surface->scale - (new_width % surface->scale);
if (buffer_width != new_width || buffer_height != new_height) { if (buffer_width != new_width || buffer_height != new_height) {
destroy_buffer(surface->current_buffer); destroy_buffer(surface->current_buffer);
surface->indicator_width = new_width; surface->indicator_width = new_width;
surface->indicator_height = new_height; surface->indicator_height = new_height;
render_frame(surface); render_frame(surface);
}
} }
wl_surface_set_buffer_scale(surface->child, surface->scale); wl_surface_set_buffer_scale(surface->child, surface->scale);