From 2e7401772e740487bed27fc07c4d83398480ae6a Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 25 Aug 2018 19:29:04 +1000 Subject: Rename sway_root.outputs to sway_root.all_outputs This list includes disabled outputs. When sway_container is demoted, we'll need to store the root's children (ie. enabled outputs) in the sway_root. It makes sense to put these in a list called `outputs`, so I'm renaming the existing list in advance. --- include/sway/tree/root.h | 2 +- sway/config/output.c | 6 ++++-- sway/desktop/output.c | 2 +- sway/ipc-server.c | 2 +- sway/tree/root.c | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index ee4bd836..f9d83874 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h @@ -21,7 +21,7 @@ struct sway_root { struct wlr_texture *debug_tree; - struct wl_list outputs; // sway_output::link + struct wl_list all_outputs; // sway_output::link list_t *scratchpad; // struct sway_container list_t *saved_workspaces; // For when there's no connected outputs diff --git a/sway/config/output.c b/sway/config/output.c index 7f9b1007..d939eea6 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -288,7 +288,8 @@ void apply_output_config_to_outputs(struct output_config *oc) { bool wildcard = strcmp(oc->name, "*") == 0; char id[128]; struct sway_output *sway_output; - wl_list_for_each(sway_output, &root_container.sway_root->outputs, link) { + wl_list_for_each(sway_output, + &root_container.sway_root->all_outputs, link) { char *name = sway_output->wlr_output->name; output_get_identifier(id, sizeof(id), sway_output); if (wildcard || !strcmp(name, oc->name) || !strcmp(id, oc->name)) { @@ -348,7 +349,8 @@ static void default_output_config(struct output_config *oc, void create_default_output_configs(void) { struct sway_output *sway_output; - wl_list_for_each(sway_output, &root_container.sway_root->outputs, link) { + wl_list_for_each(sway_output, + &root_container.sway_root->all_outputs, link) { char *name = sway_output->wlr_output->name; struct output_config *oc = new_output_config(name); default_output_config(oc, sway_output->wlr_output); diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 401d3c44..f95d9965 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -556,7 +556,7 @@ void handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.destroy, &output->destroy); output->destroy.notify = handle_destroy; - wl_list_insert(&root_container.sway_root->outputs, &output->link); + wl_list_insert(&root_container.sway_root->all_outputs, &output->link); if (!wl_list_empty(&wlr_output->modes)) { struct wlr_output_mode *mode = diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 34e940ad..49342f47 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -615,7 +615,7 @@ void ipc_client_handle_command(struct ipc_client *client) { } } struct sway_output *output; - wl_list_for_each(output, &root_container.sway_root->outputs, link) { + wl_list_for_each(output, &root_container.sway_root->all_outputs, link) { if (!output->swayc) { json_object_array_add(outputs, ipc_json_describe_disabled_output(output)); diff --git a/sway/tree/root.c b/sway/tree/root.c index 5602f0a0..2dd8f9f2 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c @@ -32,7 +32,7 @@ void root_create(void) { 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); + wl_list_init(&root_container.sway_root->all_outputs); #ifdef HAVE_XWAYLAND wl_list_init(&root_container.sway_root->xwayland_unmanaged); #endif -- cgit v1.2.3-54-g00ecf From 1e024b91fab9df3458c2fd7535e8bbe2a37c0997 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 25 Aug 2018 23:42:04 +1000 Subject: Add comment for sway_root.all_outputs --- include/sway/tree/root.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index f9d83874..ec6516c9 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h @@ -21,6 +21,7 @@ struct sway_root { struct wlr_texture *debug_tree; + // Includes disabled outputs struct wl_list all_outputs; // sway_output::link list_t *scratchpad; // struct sway_container -- cgit v1.2.3-54-g00ecf