From 04489ff4209dc073027419d90961367cfb998fe8 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 3 Aug 2018 23:06:01 +1000 Subject: Separate root-related code This creates a root.c and moves bits and pieces from elsewhere into it. * layout_init has been renamed to root_create and moved into root.c * root_destroy has been created and is called on shutdown * scratchpad code has been moved into root.c, because hidden scratchpad containers are stored in the root struct --- sway/tree/container.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sway/tree/container.c') diff --git a/sway/tree/container.c b/sway/tree/container.c index 4a503652..6da5ac3c 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -17,7 +17,6 @@ #include "sway/input/seat.h" #include "sway/ipc-server.h" #include "sway/output.h" -#include "sway/scratchpad.h" #include "sway/server.h" #include "sway/tree/arrange.h" #include "sway/tree/layout.h" @@ -336,7 +335,6 @@ static struct sway_container *container_destroy_noreaping( // Workspaces will refuse to be destroyed if they're the last workspace // on their output. if (!container_workspace_destroy(con)) { - wlr_log(WLR_ERROR, "workspace doesn't want to destroy"); return NULL; } } @@ -347,7 +345,7 @@ static struct sway_container *container_destroy_noreaping( container_set_dirty(con); if (con->scratchpad) { - scratchpad_remove_container(con); + root_scratchpad_remove_container(con); } if (!con->parent) { @@ -1097,7 +1095,7 @@ void container_set_floating(struct sway_container *container, bool enable) { } else { // Returning to tiled if (container->scratchpad) { - scratchpad_remove_container(container); + root_scratchpad_remove_container(container); } container_remove_child(container); struct sway_container *reference = -- cgit v1.2.3