aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-16 10:22:01 -0400
committerGitHub <noreply@github.com>2018-09-16 10:22:01 -0400
commit456b91600d73edb3187c170eb6720b1c3212351c (patch)
tree318401a7a3c0e8f778d45e4ea26f5517e05191fa /sway/input
parent5192f74be132a563e30b240415b385e67cbacadb (diff)
parentf6e218a64371b02afdf6b7812a52d70b13635ef3 (diff)
Merge pull request #2637 from RyanDwyer/fix-tabbed-workspace-shenanigans
Make seat_get_active_child ignore floating children
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/seat.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index ab5047b2..49fe46ba 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -880,7 +880,7 @@ struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat,
return NULL;
}
-struct sway_node *seat_get_active_child(struct sway_seat *seat,
+struct sway_node *seat_get_active_tiling_child(struct sway_seat *seat,
struct sway_node *parent) {
if (node_is_view(parent)) {
return parent;
@@ -888,9 +888,17 @@ struct sway_node *seat_get_active_child(struct sway_seat *seat,
struct sway_seat_node *current;
wl_list_for_each(current, &seat->focus_stack, link) {
struct sway_node *node = current->node;
- if (node_get_parent(node) == parent) {
- return node;
+ if (node_get_parent(node) != parent) {
+ continue;
}
+ if (parent->type == N_WORKSPACE) {
+ // Only consider tiling children
+ struct sway_workspace *ws = parent->sway_workspace;
+ if (list_find(ws->tiling, node->sway_container) == -1) {
+ continue;
+ }
+ }
+ return node;
}
return NULL;
}