reset layer index on rotation

If there are more layers in one orientation than the other this can
cause wvkbd to overshoot the end of the layer list when switching
layers. It also means that switching layers after rotating will jump to
the next layer in the list, which is somewhat unexpected.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
ArenM 2022-07-05 11:40:58 -04:00 committed by Maarten van Gompel
parent 9d6696fb23
commit c1b95f2700

1
main.c
View File

@ -273,6 +273,7 @@ display_handle_geometry(void *data, struct wl_output *wl_output, int x, int y,
keyboard.layout = &keyboard.layouts[layer];
keyboard.prevlayout = keyboard.layout;
keyboard.layer_index = 0;
if (layer_surface) {
zwlr_layer_surface_v1_set_size(layer_surface, 0, height);