diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-25 21:07:59 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-25 21:07:59 +1000 |
commit | db38b9bbf3cce4083c538209a7ce5ef1a1cf5f3f (patch) | |
tree | 3ee9f0c2bf76907b2854bf6ba2be8ab124b74fb9 /sway/tree/layout.c | |
parent | Merge pull request #2028 from RyanDwyer/fix-move-workspace (diff) | |
download | sway-db38b9bbf3cce4083c538209a7ce5ef1a1cf5f3f.tar.gz sway-db38b9bbf3cce4083c538209a7ce5ef1a1cf5f3f.tar.zst sway-db38b9bbf3cce4083c538209a7ce5ef1a1cf5f3f.zip |
Clean up container title functions
* Add and use lenient_strcat and lenient_strncat functions
* Rename `concatenate_child_titles` function as that's no longer what it
does
* Rename `container_notify_child_title_changed` because we only need to
notify that the tree structure has changed, not titles
* Don't notify parents when a child changes its title
* Update ancestor titles when changing a container's layout
* Eg. create nested tabs and change the inner container to stacking
* No need to store tree presentation in both container->name and
formatted_title
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 91759f7b..edc24deb 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c | |||
@@ -149,7 +149,7 @@ struct sway_container *container_remove_child(struct sway_container *child) { | |||
149 | } | 149 | } |
150 | } | 150 | } |
151 | child->parent = NULL; | 151 | child->parent = NULL; |
152 | container_notify_child_title_changed(parent); | 152 | container_notify_subtree_changed(parent); |
153 | 153 | ||
154 | return parent; | 154 | return parent; |
155 | } | 155 | } |
@@ -184,8 +184,8 @@ void container_move_to(struct sway_container *container, | |||
184 | container_sort_workspaces(new_parent); | 184 | container_sort_workspaces(new_parent); |
185 | seat_set_focus(seat, new_parent); | 185 | seat_set_focus(seat, new_parent); |
186 | } | 186 | } |
187 | container_notify_child_title_changed(old_parent); | 187 | container_notify_subtree_changed(old_parent); |
188 | container_notify_child_title_changed(new_parent); | 188 | container_notify_subtree_changed(new_parent); |
189 | if (old_parent) { | 189 | if (old_parent) { |
190 | if (old_parent->type == C_OUTPUT) { | 190 | if (old_parent->type == C_OUTPUT) { |
191 | arrange_output(old_parent); | 191 | arrange_output(old_parent); |
@@ -497,8 +497,8 @@ void container_move(struct sway_container *container, | |||
497 | } | 497 | } |
498 | } | 498 | } |
499 | 499 | ||
500 | container_notify_child_title_changed(old_parent); | 500 | container_notify_subtree_changed(old_parent); |
501 | container_notify_child_title_changed(container->parent); | 501 | container_notify_subtree_changed(container->parent); |
502 | 502 | ||
503 | if (old_parent) { | 503 | if (old_parent) { |
504 | seat_set_focus(config->handler_context.seat, old_parent); | 504 | seat_set_focus(config->handler_context.seat, old_parent); |
@@ -847,7 +847,7 @@ struct sway_container *container_split(struct sway_container *child, | |||
847 | container_add_child(cont, child); | 847 | container_add_child(cont, child); |
848 | } | 848 | } |
849 | 849 | ||
850 | container_notify_child_title_changed(cont); | 850 | container_notify_subtree_changed(cont); |
851 | 851 | ||
852 | return cont; | 852 | return cont; |
853 | } | 853 | } |