diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-03 23:06:01 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-04 14:01:20 +1000 |
commit | 04489ff4209dc073027419d90961367cfb998fe8 (patch) | |
tree | d6f6213d2374e10a875e8ced872511e6e656ae3e /sway/tree/container.c | |
parent | Merge pull request #2419 from RedSoxFan/fix-2416 (diff) | |
download | sway-04489ff4209dc073027419d90961367cfb998fe8.tar.gz sway-04489ff4209dc073027419d90961367cfb998fe8.tar.zst sway-04489ff4209dc073027419d90961367cfb998fe8.zip |
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
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 6 |
1 files changed, 2 insertions, 4 deletions
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 @@ | |||
17 | #include "sway/input/seat.h" | 17 | #include "sway/input/seat.h" |
18 | #include "sway/ipc-server.h" | 18 | #include "sway/ipc-server.h" |
19 | #include "sway/output.h" | 19 | #include "sway/output.h" |
20 | #include "sway/scratchpad.h" | ||
21 | #include "sway/server.h" | 20 | #include "sway/server.h" |
22 | #include "sway/tree/arrange.h" | 21 | #include "sway/tree/arrange.h" |
23 | #include "sway/tree/layout.h" | 22 | #include "sway/tree/layout.h" |
@@ -336,7 +335,6 @@ static struct sway_container *container_destroy_noreaping( | |||
336 | // Workspaces will refuse to be destroyed if they're the last workspace | 335 | // Workspaces will refuse to be destroyed if they're the last workspace |
337 | // on their output. | 336 | // on their output. |
338 | if (!container_workspace_destroy(con)) { | 337 | if (!container_workspace_destroy(con)) { |
339 | wlr_log(WLR_ERROR, "workspace doesn't want to destroy"); | ||
340 | return NULL; | 338 | return NULL; |
341 | } | 339 | } |
342 | } | 340 | } |
@@ -347,7 +345,7 @@ static struct sway_container *container_destroy_noreaping( | |||
347 | container_set_dirty(con); | 345 | container_set_dirty(con); |
348 | 346 | ||
349 | if (con->scratchpad) { | 347 | if (con->scratchpad) { |
350 | scratchpad_remove_container(con); | 348 | root_scratchpad_remove_container(con); |
351 | } | 349 | } |
352 | 350 | ||
353 | if (!con->parent) { | 351 | if (!con->parent) { |
@@ -1097,7 +1095,7 @@ void container_set_floating(struct sway_container *container, bool enable) { | |||
1097 | } else { | 1095 | } else { |
1098 | // Returning to tiled | 1096 | // Returning to tiled |
1099 | if (container->scratchpad) { | 1097 | if (container->scratchpad) { |
1100 | scratchpad_remove_container(container); | 1098 | root_scratchpad_remove_container(container); |
1101 | } | 1099 | } |
1102 | container_remove_child(container); | 1100 | container_remove_child(container); |
1103 | struct sway_container *reference = | 1101 | struct sway_container *reference = |