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

@ -407,7 +407,7 @@ int main(int argc, char **argv) {
wlr_log(WLR_INFO, "Starting sway version " SWAY_VERSION);
layout_init();
root_create();
if (!server_init(&server)) {
return 1;
@ -464,6 +464,7 @@ int main(int argc, char **argv) {
wlr_log(WLR_INFO, "Shutting down sway");
server_fini(&server);
root_destroy();
if (config) {
free_config(config);