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.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index d5325c31..b7d1a41b 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -1,5 +1,7 @@
1#include <wayland-server.h> 1#include <wayland-server.h>
2#include <wlr/types/wlr_output_layout.h> 2#include <wlr/types/wlr_output_layout.h>
3#include "log.h"
4#include "sway/output.h"
3#include "sway/tree/container.h" 5#include "sway/tree/container.h"
4#include "sway/tree/layout.h" 6#include "sway/tree/layout.h"
5#include "sway/tree/view.h" 7#include "sway/tree/view.h"
@@ -94,3 +96,28 @@ void view_update_outputs(struct sway_view *view, const struct wlr_box *before) {
94 } 96 }
95 } 97 }
96} 98}
99
100struct sway_container *container_view_destroy(struct sway_container *view) {
101 if (!view) {
102 return NULL;
103 }
104 wlr_log(L_DEBUG, "Destroying view '%s'", view->name);
105 struct sway_container *parent = container_destroy(view);
106 arrange_windows(parent, -1, -1);
107 return parent;
108}
109
110void view_damage_whole(struct sway_view *view) {
111 struct sway_container *cont = NULL;
112 for (int i = 0; i < root_container.children->length; ++i) {
113 cont = root_container.children->items[i];
114 if (cont->type == C_OUTPUT) {
115 output_damage_whole_view(cont->sway_output, view);
116 }
117 }
118}
119
120void view_damage_from(struct sway_view *view) {
121 // TODO
122 view_damage_whole(view);
123}