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/layout.c | |
parent | 5de2223c6df480759ee6d8f4422c2643491595d0 (diff) |
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/layout.c')
-rw-r--r-- | sway/tree/layout.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 1f82e534..07de9664 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -19,40 +19,6 @@ #include "list.h" #include "log.h" -struct sway_container root_container; - -static void output_layout_handle_change(struct wl_listener *listener, - void *data) { - arrange_windows(&root_container); - transaction_commit_dirty(); -} - -void layout_init(void) { - root_container.id = 0; // normally assigned in new_swayc() - root_container.type = C_ROOT; - root_container.layout = L_NONE; - root_container.name = strdup("root"); - root_container.instructions = create_list(); - root_container.children = create_list(); - root_container.current.children = create_list(); - wl_signal_init(&root_container.events.destroy); - - root_container.sway_root = calloc(1, sizeof(*root_container.sway_root)); - root_container.sway_root->output_layout = wlr_output_layout_create(); - wl_list_init(&root_container.sway_root->outputs); -#ifdef HAVE_XWAYLAND - wl_list_init(&root_container.sway_root->xwayland_unmanaged); -#endif - wl_list_init(&root_container.sway_root->drag_icons); - wl_signal_init(&root_container.sway_root->events.new_container); - root_container.sway_root->scratchpad = create_list(); - - root_container.sway_root->output_layout_change.notify = - output_layout_handle_change; - wl_signal_add(&root_container.sway_root->output_layout->events.change, - &root_container.sway_root->output_layout_change); -} - static int index_child(const struct sway_container *child) { struct sway_container *parent = child->parent; for (int i = 0; i < parent->children->length; ++i) { |