sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit b2ee5bc05d1f112e2f80a50749f91d58fc89b167
parent 07d7af593d89e56cad664fe03673ccb79da21380
Author: Kenny Levinsen <kl@kl.wtf>
Date:   Thu, 29 Aug 2019 17:22:01 +0200

Ensure that seat->focused_layer is cleared on unmap

The current seat may have changed between the last focus change and
this unmap, so we need to scan through all seats to find our layer.

Diffstat:
Msway/desktop/layer_shell.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c @@ -301,9 +301,11 @@ static void unmap(struct sway_layer_surface *sway_layer) { output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y, sway_layer->layer_surface->surface, true); - struct sway_seat *seat = input_manager_current_seat(); - if (seat->focused_layer == sway_layer->layer_surface) { - seat_set_focus_layer(seat, NULL); + struct sway_seat *seat; + wl_list_for_each(seat, &server.input->seats, link) { + if (seat->focused_layer == sway_layer->layer_surface) { + seat_set_focus_layer(seat, NULL); + } } cursor_rebase_all();