sway

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

commit acd3db4fe1f8bfabc2e9edb8ac6cff706fdfaaf3
parent 3e33e1c76ff58154768a7789c946bd142f9f3dc2
Author: Brian Ashworth <bosrsf04@gmail.com>
Date:   Mon, 12 Aug 2019 22:03:50 -0400

workspace: do not destroy if any seat is focusing

Since each seat has its own focus, do not destroy a workspace until it
is no longer focused by any seat. This prevents seats from being forced
to evacuate the workspace just because another seat switched focus away
from it

Diffstat:
Msway/tree/workspace.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c @@ -155,9 +155,19 @@ void workspace_consider_destroy(struct sway_workspace *ws) { if (ws->tiling->length || ws->floating->length) { return; } + if (ws->output && output_get_active_workspace(ws->output) == ws) { return; } + + struct sway_seat *seat; + wl_list_for_each(seat, &server.input->seats, link) { + struct sway_node *node = seat_get_focus_inactive(seat, &root->node); + if (node == &ws->node) { + return; + } + } + workspace_begin_destroy(ws); }