Keyboard: Avoid unnecessary resizes

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
Zach DeCook 2022-06-24 11:33:43 -04:00 committed by Maarten van Gompel
parent 28c24749ba
commit 22ff01fb8b

8
main.c
View File

@ -328,9 +328,11 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) {}
void
layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface,
uint32_t serial, uint32_t w, uint32_t h) {
keyboard.w = w + KBD_PIXEL_OVERSCAN_WIDTH;
keyboard.h = h;
kbd_resize(&keyboard, layouts, NumLayouts);
if ( keyboard.w != w + KBD_PIXEL_OVERSCAN_WIDTH || keyboard.h != h ) {
keyboard.w = w + KBD_PIXEL_OVERSCAN_WIDTH;
keyboard.h = h;
kbd_resize(&keyboard, layouts, NumLayouts);
}
zwlr_layer_surface_v1_ack_configure(surface, serial);
}