summaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 7bf7325a..ba4a880f 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -35,7 +35,7 @@ void view_init(struct sway_view *view, enum sway_view_type type,
35 wl_signal_init(&view->events.unmap); 35 wl_signal_init(&view->events.unmap);
36} 36}
37 37
38void view_free(struct sway_view *view) { 38void view_destroy(struct sway_view *view) {
39 if (!sway_assert(view->surface == NULL, "Tried to free mapped view")) { 39 if (!sway_assert(view->surface == NULL, "Tried to free mapped view")) {
40 return; 40 return;
41 } 41 }
@@ -75,14 +75,14 @@ void view_free(struct sway_view *view) {
75 * destroying flag will make the view get freed when the transaction is 75 * destroying flag will make the view get freed when the transaction is
76 * finished. 76 * finished.
77 */ 77 */
78void view_destroy(struct sway_view *view) { 78void view_begin_destroy(struct sway_view *view) {
79 if (!sway_assert(view->surface == NULL, "Tried to destroy a mapped view")) { 79 if (!sway_assert(view->surface == NULL, "Tried to destroy a mapped view")) {
80 return; 80 return;
81 } 81 }
82 view->destroying = true; 82 view->destroying = true;
83 83
84 if (!view->swayc) { 84 if (!view->swayc) {
85 view_free(view); 85 view_destroy(view);
86 } 86 }
87} 87}
88 88
@@ -560,7 +560,9 @@ void view_unmap(struct sway_view *view) {
560 } 560 }
561 561
562 bool was_fullscreen = view->swayc->is_fullscreen; 562 bool was_fullscreen = view->swayc->is_fullscreen;
563 struct sway_container *surviving_ancestor = container_destroy(view->swayc); 563 struct sway_container *parent = view->swayc->parent;
564 container_begin_destroy(view->swayc);
565 struct sway_container *surviving_ancestor = container_reap_empty(parent);
564 566
565 // If the workspace wasn't reaped 567 // If the workspace wasn't reaped
566 if (surviving_ancestor && surviving_ancestor->type >= C_WORKSPACE) { 568 if (surviving_ancestor && surviving_ancestor->type >= C_WORKSPACE) {