aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-12-12 01:24:17 -0500
committerLibravatar emersion <contact@emersion.fr>2018-12-12 10:13:50 +0100
commitbc981b2bbb7e07d104aebcb3dae5ec2480fc23e4 (patch)
tree9900e3721a38b01ac25257f460a79f769ad1b5ff /sway/input/seat.c
parentCall wlr_output_enable for disabled new outputs (diff)
downloadsway-bc981b2bbb7e07d104aebcb3dae5ec2480fc23e4.tar.gz
sway-bc981b2bbb7e07d104aebcb3dae5ec2480fc23e4.tar.zst
sway-bc981b2bbb7e07d104aebcb3dae5ec2480fc23e4.zip
Keep focus when destroying containers on nonvis ws
Changing the focus stack when destroying a container's node on a non-visible workspace (on an non-focused output) incorrectly causes the non-visible workspace to become visible. If the workspace is empty, it will not be destroyed since it is now visible. Additionally since there was no workspace::focus event, swaybar still shows the previous workspace as focus-inactive. It also makes no sense to change visible workspaces due to a container on a non-visible workspace being destroyed. Since the focus will either be set when switching to the non-visible workspace or the workspace will be destroyed due to being empty, there is no need to change the focus stack when destroying a container on a non-visible workspace.
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 53fb2ed7..1dd99cb2 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -159,6 +159,14 @@ static void handle_seat_node_destroy(struct wl_listener *listener, void *data) {
159 return; 159 return;
160 } 160 }
161 161
162 if (node->type == N_CONTAINER &&
163 !workspace_is_visible(node->sway_container->workspace)) {
164 // Do not change the focus stack on a non-visible workspace. The focus
165 // will either be set when the workspace becomes visible or the
166 // workspace is now empty and will be destroyed
167 return;
168 }
169
162 // Find new focus_inactive (ie. sibling, or workspace if no siblings left) 170 // Find new focus_inactive (ie. sibling, or workspace if no siblings left)
163 struct sway_node *next_focus = NULL; 171 struct sway_node *next_focus = NULL;
164 while (next_focus == NULL) { 172 while (next_focus == NULL) {