Don't drop the buffer until after surface commit
This commit is contained in:
parent
31ebd85fe0
commit
2018673e1d
8
render.c
8
render.c
@ -42,6 +42,8 @@ void render_frame_background(struct swaylock_surface *surface) {
|
|||||||
return; // not yet configured
|
return; // not yet configured
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_surface_set_buffer_scale(surface->surface, surface->scale);
|
||||||
|
|
||||||
if (buffer_width != surface->last_buffer_width ||
|
if (buffer_width != surface->last_buffer_width ||
|
||||||
buffer_height != surface->last_buffer_height) {
|
buffer_height != surface->last_buffer_height) {
|
||||||
struct pool_buffer buffer;
|
struct pool_buffer buffer;
|
||||||
@ -69,14 +71,14 @@ void render_frame_background(struct swaylock_surface *surface) {
|
|||||||
|
|
||||||
wl_surface_attach(surface->surface, buffer.buffer, 0, 0);
|
wl_surface_attach(surface->surface, buffer.buffer, 0, 0);
|
||||||
wl_surface_damage_buffer(surface->surface, 0, 0, INT32_MAX, INT32_MAX);
|
wl_surface_damage_buffer(surface->surface, 0, 0, INT32_MAX, INT32_MAX);
|
||||||
|
wl_surface_commit(surface->surface);
|
||||||
destroy_buffer(&buffer);
|
destroy_buffer(&buffer);
|
||||||
|
|
||||||
surface->last_buffer_width = buffer_width;
|
surface->last_buffer_width = buffer_width;
|
||||||
surface->last_buffer_height = buffer_height;
|
surface->last_buffer_height = buffer_height;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
wl_surface_set_buffer_scale(surface->surface, surface->scale);
|
|
||||||
wl_surface_commit(surface->surface);
|
wl_surface_commit(surface->surface);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void configure_font_drawing(cairo_t *cairo, struct swaylock_state *state,
|
static void configure_font_drawing(cairo_t *cairo, struct swaylock_state *state,
|
||||||
|
Loading…
Reference in New Issue
Block a user