aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c17
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) {