diff options
-rw-r--r-- | sway/desktop/layer_shell.c | 5 | ||||
-rw-r--r-- | sway/input/seat.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index b60aa487..2d355b74 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -257,6 +257,11 @@ static void unmap(struct sway_layer_surface *sway_layer) { | |||
257 | } | 257 | } |
258 | output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y, | 258 | output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y, |
259 | sway_layer->layer_surface->surface, true); | 259 | sway_layer->layer_surface->surface, true); |
260 | |||
261 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
262 | if (seat->focused_layer == sway_layer->layer_surface) { | ||
263 | seat_set_focus_layer(seat, NULL); | ||
264 | } | ||
260 | } | 265 | } |
261 | 266 | ||
262 | static void handle_destroy(struct wl_listener *listener, void *data) { | 267 | static void handle_destroy(struct wl_listener *listener, void *data) { |
diff --git a/sway/input/seat.c b/sway/input/seat.c index 0e539b70..071ef020 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -658,7 +658,8 @@ void seat_set_focus_layer(struct sway_seat *seat, | |||
658 | struct wlr_layer_surface *layer) { | 658 | struct wlr_layer_surface *layer) { |
659 | if (!layer && seat->focused_layer) { | 659 | if (!layer && seat->focused_layer) { |
660 | seat->focused_layer = NULL; | 660 | seat->focused_layer = NULL; |
661 | struct sway_container *previous = seat_get_focus(seat); | 661 | struct sway_container *previous = |
662 | seat_get_focus_inactive(seat, &root_container); | ||
662 | if (previous) { | 663 | if (previous) { |
663 | wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", previous, | 664 | wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", previous, |
664 | container_type_to_str(previous->type), previous->name); | 665 | container_type_to_str(previous->type), previous->name); |