sway: prevent layer-shell-surfaces from receiving input when it is inhibited

seat_set_focus_layer is missing an inhibition check allowing layer-shell surfaces to be focused even when it is inhibited.
layer-shell surfaces also don't lose keyboard focus in seat_set_exclusive_client.
This breaks assumptions made by input_inhibitor clients.
This commit is contained in:
Robin Ebert 2022-06-15 09:25:38 +02:00
parent 1c69d0e72f
commit 625b6e1ec4
No known key found for this signature in database
GPG key ID: 8B6531570DC10850

View file

@ -1326,7 +1326,7 @@ void seat_set_focus_layer(struct sway_seat *seat,
seat_set_focus(seat, previous);
}
return;
} else if (!layer || seat->focused_layer == layer) {
} else if (!layer || seat->focused_layer == layer || !seat_is_input_allowed(seat, layer->surface)) {
return;
}
assert(layer->mapped);
@ -1362,7 +1362,12 @@ void seat_set_exclusive_client(struct sway_seat *seat,
}
if (seat->wlr_seat->pointer_state.focused_client) {
if (seat->wlr_seat->pointer_state.focused_client->client != client) {
wlr_seat_pointer_notify_clear_focus(seat->wlr_seat);
wlr_seat_pointer_clear_focus(seat->wlr_seat);
}
}
if (seat->wlr_seat->keyboard_state.focused_client) {
if (seat->wlr_seat->keyboard_state.focused_client->client != client) {
wlr_seat_keyboard_clear_focus(seat->wlr_seat);
}
}
struct timespec now;