diff options
author | emersion <contact@emersion.fr> | 2018-04-04 00:26:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 00:26:31 -0400 |
commit | dee71871d7a37cfa1e53f3f1f60e6e93d21beda4 (patch) | |
tree | 1565ba1fede2da35b170353f895c34205216dc38 /sway/tree/view.c | |
parent | 3ea7d2d10ed0d6d68e5bf3dd4efac765eb2b0212 (diff) | |
parent | 62c79ef4510d4687e35deab177cf5114a138261f (diff) |
Merge pull request #1702 from acrisci/split-containers2
properly close container containers
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 09c804e4..aa010a40 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -27,8 +27,7 @@ void view_destroy(struct sway_view *view) { view_unmap(view); } - container_view_destroy(view->swayc); - free(view); + container_destroy(view->swayc); } const char *view_get_title(struct sway_view *view) { @@ -78,16 +77,6 @@ void view_close(struct sway_view *view) { } } -struct sway_container *container_view_destroy(struct sway_container *view) { - if (!view) { - return NULL; - } - wlr_log(L_DEBUG, "Destroying view '%s'", view->name); - struct sway_container *parent = container_destroy(view); - arrange_windows(parent, -1, -1); - return parent; -} - void view_damage_whole(struct sway_view *view) { for (int i = 0; i < root_container.children->length; ++i) { struct sway_container *cont = root_container.children->items[i]; @@ -160,10 +149,12 @@ void view_unmap(struct sway_view *view) { view_damage_whole(view); - container_view_destroy(view->swayc); + struct sway_container *parent = container_destroy(view->swayc); view->swayc = NULL; view->surface = NULL; + + arrange_windows(parent, -1, -1); } void view_update_position(struct sway_view *view, double ox, double oy) { |