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
This commit is contained in:
Ryan Dwyer 2018-08-03 23:06:01 +10:00
parent 5de2223c6d
commit 04489ff420
12 changed files with 292 additions and 275 deletions

View file

@ -9,10 +9,9 @@
#include "sway/input/cursor.h"
#include "sway/input/seat.h"
#include "sway/output.h"
#include "sway/scratchpad.h"
#include "sway/tree/arrange.h"
#include "sway/tree/container.h"
#include "sway/tree/layout.h"
#include "sway/tree/root.h"
#include "sway/tree/workspace.h"
#include "stringop.h"
#include "list.h"
@ -324,7 +323,7 @@ static struct cmd_results *move_to_scratchpad(struct sway_container *con) {
return cmd_results_new(CMD_INVALID, "move",
"Container is already in the scratchpad");
}
scratchpad_add_container(con);
root_scratchpad_add_container(con);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}