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
This commit is contained in:
Brian Ashworth 2019-08-12 22:03:50 -04:00 committed by Drew DeVault
parent e8204a852d
commit 63651bc5e0

View file

@ -155,9 +155,19 @@ void workspace_consider_destroy(struct sway_workspace *ws) {
if (ws->tiling->length || ws->floating->length) { if (ws->tiling->length || ws->floating->length) {
return; return;
} }
if (ws->output && output_get_active_workspace(ws->output) == ws) { if (ws->output && output_get_active_workspace(ws->output) == ws) {
return; 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); workspace_begin_destroy(ws);
} }