diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-28 12:45:42 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-28 12:45:42 +1000 |
commit | 7c7d24600b3db2675b691ae6345ef3fefab03dbd (patch) | |
tree | 27bdca654ca7336acc9018aeedbf6a46751a85c2 /sway/tree | |
parent | Merge pull request #2050 from smlx/focus-fix (diff) | |
download | sway-7c7d24600b3db2675b691ae6345ef3fefab03dbd.tar.gz sway-7c7d24600b3db2675b691ae6345ef3fefab03dbd.tar.zst sway-7c7d24600b3db2675b691ae6345ef3fefab03dbd.zip |
Fix ancestor typos
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 6 | ||||
-rw-r--r-- | sway/tree/layout.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index a4798c7e..59137d88 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -656,11 +656,11 @@ void container_for_each_descendant_bfs(struct sway_container *con, | |||
656 | } | 656 | } |
657 | } | 657 | } |
658 | 658 | ||
659 | bool container_has_anscestor(struct sway_container *descendant, | 659 | bool container_has_ancestor(struct sway_container *descendant, |
660 | struct sway_container *anscestor) { | 660 | struct sway_container *ancestor) { |
661 | while (descendant->type != C_ROOT) { | 661 | while (descendant->type != C_ROOT) { |
662 | descendant = descendant->parent; | 662 | descendant = descendant->parent; |
663 | if (descendant == anscestor) { | 663 | if (descendant == ancestor) { |
664 | return true; | 664 | return true; |
665 | } | 665 | } |
666 | } | 666 | } |
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 624d5516..aca9e254 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -157,7 +157,7 @@ struct sway_container *container_remove_child(struct sway_container *child) { | |||
157 | void container_move_to(struct sway_container *container, | 157 | void container_move_to(struct sway_container *container, |
158 | struct sway_container *destination) { | 158 | struct sway_container *destination) { |
159 | if (container == destination | 159 | if (container == destination |
160 | || container_has_anscestor(container, destination)) { | 160 | || container_has_ancestor(container, destination)) { |
161 | return; | 161 | return; |
162 | } | 162 | } |
163 | struct sway_container *old_parent = container_remove_child(container); | 163 | struct sway_container *old_parent = container_remove_child(container); |
@@ -945,9 +945,9 @@ void container_swap(struct sway_container *con1, struct sway_container *con2) { | |||
945 | "Can only swap containers and views")) { | 945 | "Can only swap containers and views")) { |
946 | return; | 946 | return; |
947 | } | 947 | } |
948 | if (!sway_assert(!container_has_anscestor(con1, con2) | 948 | if (!sway_assert(!container_has_ancestor(con1, con2) |
949 | && !container_has_anscestor(con2, con1), | 949 | && !container_has_ancestor(con2, con1), |
950 | "Cannot swap anscestor and descendant")) { | 950 | "Cannot swap ancestor and descendant")) { |
951 | return; | 951 | return; |
952 | } | 952 | } |
953 | if (!sway_assert(con1->layout != L_FLOATING && con2->layout != L_FLOATING, | 953 | if (!sway_assert(con1->layout != L_FLOATING && con2->layout != L_FLOATING, |