summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-08-12 22:03:50 -0400
committerDrew DeVault <sir@cmpwn.com>2019-08-20 13:27:52 +0900
commit63651bc5e0457e9c05f3d1c0ebbf8c1d2b767550 (patch)
tree22a5f25cc6d97c007802193df8b67aba8fc2586d
parente8204a852dc7bfa93cd1a7e9626adb3ddc3a00ad (diff)
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
-rw-r--r--sway/tree/workspace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index d6819c612..03869d2eb 100644
--- 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);
}