summaryrefslogtreecommitdiff
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorTony Crisci <[email protected]>2018-04-02 22:37:21 -0400
committerTony Crisci <[email protected]>2018-04-02 22:37:21 -0400
commit2992b72d61933568476e2bf4baf573e714f9ed40 (patch)
tree0682e081d94d73ef2b4b9a7f8d1646c11bb33b8e /sway/tree/layout.c
parent2c165e1288cbb60f5e677595e35f58a9c56c7010 (diff)
change reap container approach
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index b0ce4aaf..79470f98 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -103,32 +103,6 @@ void container_add_child(struct sway_container *parent,
child->parent = parent;
}
-struct sway_container *container_reap_empty(struct sway_container *container) {
- if (container == NULL) {
- return NULL;
- }
- wlr_log(L_DEBUG, "Reaping %p %s '%s'", container,
- container_type_to_str(container->type), container->name);
- while (container->type != C_ROOT && container->type != C_OUTPUT
- && container->children && container->children->length == 0) {
- if (container->type == C_WORKSPACE) {
- if (!workspace_is_visible(container)) {
- struct sway_container *parent = container->parent;
- container_workspace_destroy(container);
- return parent;
- }
- return container;
- } else if (container->type == C_CONTAINER) {
- struct sway_container *parent = container->parent;
- container_destroy(container);
- container = parent;
- } else {
- container = container->parent;
- }
- }
- return container;
-}
-
struct sway_container *container_remove_child(struct sway_container *child) {
struct sway_container *parent = child->parent;
for (int i = 0; i < parent->children->length; ++i) {
@@ -309,6 +283,8 @@ void arrange_windows(struct sway_container *container,
container->children->length);
break;
case L_VERT:
+ assert(container);
+ assert(container->children);
apply_vert_layout(container, x, y, width, height, 0,
container->children->length);
break;
@@ -381,6 +357,7 @@ void apply_vert_layout(struct sway_container *container,
const double x, const double y,
const double width, const double height, const int start,
const int end) {
+ assert(container);
int i;
double scale = 0;
// Calculate total height