aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-08-11 15:36:19 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-11 15:36:19 +1000
commit31844bf42bc4b6549862ea4c4f077c1e19d9e7a1 (patch)
treef24bbab4a5a54936ddca9b823e4103ea630e993b /sway/input
parente474d87e42d625eb4e0a41a0559bbf0e4ec5ecc5 (diff)
Remove container_has_child
In all cases you can use container_has_ancestor with the arguments swapped, which is faster than container_has_child.
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/seat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 6dd7cf7d..3cd079f4 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -145,14 +145,14 @@ static struct sway_container *seat_get_focus_by_type(struct sway_seat *seat,
continue;
}
- if (container_has_child(container, current->container)) {
+ if (container_has_ancestor(current->container, container)) {
if (only_tiling &&
container_is_floating_or_child(current->container)) {
continue;
}
return current->container;
}
- if (floating && container_has_child(floating, current->container)) {
+ if (floating && container_has_ancestor(current->container, floating)) {
return current->container;
}
}
@@ -190,7 +190,7 @@ static void handle_seat_container_destroy(struct wl_listener *listener,
bool set_focus =
focus != NULL &&
- (focus == con || container_has_child(con, focus)) &&
+ (focus == con || container_has_ancestor(focus, con)) &&
con->type != C_WORKSPACE;
seat_container_destroy(seat_con);