aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-08-12 22:03:50 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-08-13 11:30:28 +0900
commitacd3db4fe1f8bfabc2e9edb8ac6cff706fdfaaf3 (patch)
tree0e4b1931fe3efdd134545f7a553d3177aa832381 /sway/tree/workspace.c
parenthandle_seat_node_destroy: do not focus own node (diff)
downloadsway-acd3db4fe1f8bfabc2e9edb8ac6cff706fdfaaf3.tar.gz
sway-acd3db4fe1f8bfabc2e9edb8ac6cff706fdfaaf3.tar.zst
sway-acd3db4fe1f8bfabc2e9edb8ac6cff706fdfaaf3.zip
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 (limited to 'sway/tree/workspace.c')
-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 30cf3ebe..3ad5de06 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -155,9 +155,19 @@ void workspace_consider_destroy(struct sway_workspace *ws) {
155 if (ws->tiling->length || ws->floating->length) { 155 if (ws->tiling->length || ws->floating->length) {
156 return; 156 return;
157 } 157 }
158
158 if (ws->output && output_get_active_workspace(ws->output) == ws) { 159 if (ws->output && output_get_active_workspace(ws->output) == ws) {
159 return; 160 return;
160 } 161 }
162
163 struct sway_seat *seat;
164 wl_list_for_each(seat, &server.input->seats, link) {
165 struct sway_node *node = seat_get_focus_inactive(seat, &root->node);
166 if (node == &ws->node) {
167 return;
168 }
169 }
170
161 workspace_begin_destroy(ws); 171 workspace_begin_destroy(ws);
162} 172}
163 173