aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/seat.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-16 14:04:25 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-16 21:57:19 +1000
commit48bc15e758c37e73f3eb6ae76f4ad758148dbfb1 (patch)
tree436c174b1ebd717d4c3fcd6e6507e224e2ea5690 /sway/input/seat.c
parentMerge pull request #2638 from RyanDwyer/fix-tab-unmap-crash (diff)
downloadsway-48bc15e758c37e73f3eb6ae76f4ad758148dbfb1.tar.gz
sway-48bc15e758c37e73f3eb6ae76f4ad758148dbfb1.tar.zst
sway-48bc15e758c37e73f3eb6ae76f4ad758148dbfb1.zip
Make seat_get_active_child ignore floating children
seat_get_active_child is used to get the active tiling child in a few places, such as outputs getting their active workspace and tabbed/stacked containers getting their visible child. When a workspace uses a tabbed or stacked layout and contains a focused floating view, calling seat_get_active_child on the workspace would incorrectly return the floating view. This changes it so it will return the tiling child. This fixes the following bug: * Create layout T[view view] then float one of the views * Attempt to click the tiling view to give it focus - it wouldn't work because seat_get_active_child would return the floating view
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index ab5047b2..6d02970d 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -888,9 +888,17 @@ struct sway_node *seat_get_active_child(struct sway_seat *seat,
888 struct sway_seat_node *current; 888 struct sway_seat_node *current;
889 wl_list_for_each(current, &seat->focus_stack, link) { 889 wl_list_for_each(current, &seat->focus_stack, link) {
890 struct sway_node *node = current->node; 890 struct sway_node *node = current->node;
891 if (node_get_parent(node) == parent) { 891 if (node_get_parent(node) != parent) {
892 return node; 892 continue;
893 } 893 }
894 if (parent->type == N_WORKSPACE) {
895 // Only consider tiling children
896 struct sway_workspace *ws = parent->sway_workspace;
897 if (list_find(ws->tiling, node->sway_container) == -1) {
898 continue;
899 }
900 }
901 return node;
894 } 902 }
895 return NULL; 903 return NULL;
896} 904}