sway

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

commit 9350a52c0e8b502f9dc7f876da0527607a44bfec
parent cdf30033afdb4c1ead47ed208cee0c63a82b7ea4
Author: Brian Ashworth <bosrsf04@gmail.com>
Date:   Fri, 22 Feb 2019 23:09:39 -0500

handle_seat_node_destroy: update seat->workspace

If an unmanaged or layer surface is focused when an output gets
disabled and an empty workspace on the output was focused by the seat,
the seat needs to refocus it's focus inactive to update the value of
`seat->workspace`.

Diffstat:
Msway/input/seat.c | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/sway/input/seat.c b/sway/input/seat.c @@ -146,6 +146,19 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) { struct sway_node *focus = seat_get_focus(seat); if (node->type == N_WORKSPACE) { + // If an unmanaged or layer surface is focused when an output gets + // disabled and an empty workspace on the output was focused by the + // seat, the seat needs to refocus it's focus inactive to update the + // value of seat->workspace. + if (seat->workspace == node->sway_workspace) { + struct sway_node *node = seat_get_focus_inactive(seat, &root->node); + seat_set_focus(seat, NULL); + if (node) { + seat_set_focus(seat, node); + } else { + seat->workspace = NULL; + } + } seat_node_destroy(seat_node); return; }