layer-shell: refocus if keyboard interactive lost

When arranging layer-shell layers, verify that the currently focused
layer, if any, for each seat is still keyboard interactive. If the layer
is no longer keyboard interactive and there is not a keyboard
interactive overlay or top layer to change the focus to, refocus the
focus inactive node for the seat.
This commit is contained in:
Brian Ashworth 2019-12-26 19:51:06 -05:00 committed by Simon Ser
parent bd42415b5d
commit 088b374b1a

View file

@ -215,6 +215,9 @@ void arrange_layers(struct sway_output *output) {
wl_list_for_each(seat, &server.input->seats, link) {
if (topmost != NULL) {
seat_set_focus_layer(seat, topmost->layer_surface);
} else if (seat->focused_layer &&
!seat->focused_layer->current.keyboard_interactive) {
seat_set_focus_layer(seat, NULL);
}
}
}