From 8b593677d262b9018d2bcb9093f03fbccb38c43b Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Sun, 16 Feb 2020 01:47:59 -0500 Subject: output: fix updating output manager config The output manager config is created when the output is created. It is updated when the mode, transform, scale, or layout for the output changes, as well as, when the output is destroyed. Since the output->enabled property was not being set before calling apply_output_config, the output event handlers were early returning and never updating the output manager config when the output state was committed. This fixes the issue by setting output->enabled in apply_output_config below the output disabling section. There are also a few other minor changes that are required to function. Additionally, this renames output_enable to output_configure to better describe the recent changes. --- sway/tree/output.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'sway/tree') diff --git a/sway/tree/output.c b/sway/tree/output.c index 6f4146cd..c96c3187 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -102,20 +102,19 @@ struct sway_output *output_create(struct wlr_output *wlr_output) { output->workspaces = create_list(); output->current.workspaces = create_list(); + size_t len = sizeof(output->layers) / sizeof(output->layers[0]); + for (size_t i = 0; i < len; ++i) { + wl_list_init(&output->layers[i]); + } + return output; } -void output_enable(struct sway_output *output) { - if (!sway_assert(!output->enabled, "output is already enabled")) { +void output_configure(struct sway_output *output) { + if (!sway_assert(!output->configured, "output is already configured")) { return; } struct wlr_output *wlr_output = output->wlr_output; - size_t len = sizeof(output->layers) / sizeof(output->layers[0]); - for (size_t i = 0; i < len; ++i) { - wl_list_init(&output->layers[i]); - } - - output->enabled = true; output->configured = true; list_add(root->outputs, output); -- cgit v1.2.3-54-g00ecf