only commit surface when it changed

Previously wvkbd would commit an (usually) unchanged surface at the
framerate of the compositor, this only commits the buffer when we render
something new.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
ArenM
2022-07-05 12:54:33 -04:00
committed by Maarten van Gompel
parent a2cacb7e25
commit 1843e60a74
4 changed files with 8 additions and 24 deletions

7
main.c
View File

@ -341,6 +341,8 @@ layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface,
}
zwlr_layer_surface_v1_ack_configure(surface, serial);
drwsurf_flip(&draw_surf);
}
void
@ -376,11 +378,6 @@ hide() {
zwlr_layer_surface_v1_destroy(layer_surface);
wl_surface_destroy(draw_surf.surf);
layer_surface = NULL;
if (draw_surf.cb) {
wl_callback_destroy(draw_surf.cb);
draw_surf.cb = NULL;
}
hidden = true;
}