aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2019-08-29 17:22:01 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2019-09-01 00:03:18 +0300
commitb2ee5bc05d1f112e2f80a50749f91d58fc89b167 (patch)
treefb2f08179ea08590ef512e34fc413020f75c6a9e /sway/desktop/layer_shell.c
parentseat: set cursor image only if no pointer cap previously (diff)
downloadsway-b2ee5bc05d1f112e2f80a50749f91d58fc89b167.tar.gz
sway-b2ee5bc05d1f112e2f80a50749f91d58fc89b167.tar.zst
sway-b2ee5bc05d1f112e2f80a50749f91d58fc89b167.zip
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 (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index a6239bea..60270a42 100644
--- 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) {
301 output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y, 301 output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y,
302 sway_layer->layer_surface->surface, true); 302 sway_layer->layer_surface->surface, true);
303 303
304 struct sway_seat *seat = input_manager_current_seat(); 304 struct sway_seat *seat;
305 if (seat->focused_layer == sway_layer->layer_surface) { 305 wl_list_for_each(seat, &server.input->seats, link) {
306 seat_set_focus_layer(seat, NULL); 306 if (seat->focused_layer == sway_layer->layer_surface) {
307 seat_set_focus_layer(seat, NULL);
308 }
307 } 309 }
308 310
309 cursor_rebase_all(); 311 cursor_rebase_all();