diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 10 |
1 files changed, 6 insertions, 4 deletions
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) { | |||
804 | 804 | ||
805 | i = list_seq_find(config->output_configs, output_name_cmp, name); | 805 | i = list_seq_find(config->output_configs, output_name_cmp, name); |
806 | if (i >= 0) { | 806 | if (i >= 0) { |
807 | // replace existing config | 807 | // merge existing config |
808 | struct output_config *oc = config->output_configs->items[i]; | 808 | struct output_config *oc = config->output_configs->items[i]; |
809 | list_del(config->output_configs, i); | 809 | merge_output_config(oc, output); |
810 | free_output_config(oc); | 810 | free_output_config(output); |
811 | output = oc; | ||
812 | } else { | ||
813 | list_add(config->output_configs, output); | ||
811 | } | 814 | } |
812 | list_add(config->output_configs, output); | ||
813 | 815 | ||
814 | sway_log(L_DEBUG, "Config stored for output %s (enabled:%d) (%d x %d @ %d, %d) (bg %s %s)", | 816 | sway_log(L_DEBUG, "Config stored for output %s (enabled:%d) (%d x %d @ %d, %d) (bg %s %s)", |
815 | output->name, output->enabled, output->width, | 817 | output->name, output->enabled, output->width, |