diff options
author | Simon Ser <contact@emersion.fr> | 2019-08-31 23:19:47 +0300 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-01 09:58:03 +0900 |
commit | 53e01bf5c7763b5f49ce15b05f6b32f986e2b2ba (patch) | |
tree | 3eeb285b3f4bb0e434df4db66638cdf35ebf4945 /sway/input | |
parent | b2ee5bc05d1f112e2f80a50749f91d58fc89b167 (diff) | |
download | sway-53e01bf5c7763b5f49ce15b05f6b32f986e2b2ba.tar.xz |
layer-shell: don't give focus to unmapped layer surfaces
Focused layers are not cleared when destroyed, they are cleared on unmap.
Giving focus to an unmapped layer surface is (1) incorrect and (2) triggers a
use-after-free.
Closes: https://github.com/swaywm/sway/issues/4517
Diffstat (limited to 'sway/input')
-rw-r--r-- | sway/input/seat.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 4da8e937..b2243fe3 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -1095,6 +1095,7 @@ void seat_set_focus_layer(struct sway_seat *seat, } else if (!layer || seat->focused_layer == layer) { return; } + assert(layer->mapped); seat_set_focus_surface(seat, layer->surface, true); if (layer->layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP) { seat->focused_layer = layer; |