Use wl_surface.damage_buffer

We incorrectly used the buffer size instead of the surface size.
Let's not bother and just damage the maximum region.
This commit is contained in:
Simon Ser 2021-02-10 17:45:42 +01:00
parent 05325b1197
commit 9d3da72a39
2 changed files with 3 additions and 3 deletions

2
main.c
View File

@ -307,7 +307,7 @@ static void handle_global(void *data, struct wl_registry *registry,
struct swaylock_state *state = data; struct swaylock_state *state = data;
if (strcmp(interface, wl_compositor_interface.name) == 0) { if (strcmp(interface, wl_compositor_interface.name) == 0) {
state->compositor = wl_registry_bind(registry, name, state->compositor = wl_registry_bind(registry, name,
&wl_compositor_interface, 3); &wl_compositor_interface, 4);
} else if (strcmp(interface, wl_subcompositor_interface.name) == 0) { } else if (strcmp(interface, wl_subcompositor_interface.name) == 0) {
state->subcompositor = wl_registry_bind(registry, name, state->subcompositor = wl_registry_bind(registry, name,
&wl_subcompositor_interface, 1); &wl_subcompositor_interface, 1);

View File

@ -64,7 +64,7 @@ void render_frame_background(struct swaylock_surface *surface) {
wl_surface_set_buffer_scale(surface->surface, surface->scale); wl_surface_set_buffer_scale(surface->surface, surface->scale);
wl_surface_attach(surface->surface, surface->current_buffer->buffer, 0, 0); wl_surface_attach(surface->surface, surface->current_buffer->buffer, 0, 0);
wl_surface_damage(surface->surface, 0, 0, surface->width, surface->height); wl_surface_damage_buffer(surface->surface, 0, 0, INT32_MAX, INT32_MAX);
wl_surface_commit(surface->surface); wl_surface_commit(surface->surface);
} }
@ -315,7 +315,7 @@ void render_frame(struct swaylock_surface *surface) {
wl_surface_set_buffer_scale(surface->child, surface->scale); wl_surface_set_buffer_scale(surface->child, surface->scale);
wl_surface_attach(surface->child, surface->current_buffer->buffer, 0, 0); wl_surface_attach(surface->child, surface->current_buffer->buffer, 0, 0);
wl_surface_damage(surface->child, 0, 0, surface->current_buffer->width, surface->current_buffer->height); wl_surface_damage_buffer(surface->child, 0, 0, INT32_MAX, INT32_MAX);
wl_surface_commit(surface->child); wl_surface_commit(surface->child);
wl_surface_commit(surface->surface); wl_surface_commit(surface->surface);