From b1bd3ae6f3210e6b3ecda2d253518da18420e6cd Mon Sep 17 00:00:00 2001 From: Christoph Gysin Date: Sun, 29 Nov 2015 22:51:48 +0200 Subject: cmd_output: Merge instead of replace output config --- sway/commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sway/commands.c') diff --git a/sway/commands.c b/sway/commands.c index f891792f..452f3c34 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -804,12 +804,14 @@ static struct cmd_results *cmd_output(int argc, char **argv) { i = list_seq_find(config->output_configs, output_name_cmp, name); if (i >= 0) { - // replace existing config + // merge existing config struct output_config *oc = config->output_configs->items[i]; - list_del(config->output_configs, i); - free_output_config(oc); + merge_output_config(oc, output); + free_output_config(output); + output = oc; + } else { + list_add(config->output_configs, output); } - list_add(config->output_configs, output); sway_log(L_DEBUG, "Config stored for output %s (enabled:%d) (%d x %d @ %d, %d) (bg %s %s)", output->name, output->enabled, output->width, -- cgit v1.2.3