diff options
| author | Christoph Gysin <[email protected]> | 2015-11-29 22:51:48 +0200 | 
|---|---|---|
| committer | Christoph Gysin <[email protected]> | 2015-11-29 23:17:56 +0200 | 
| commit | b1bd3ae6f3210e6b3ecda2d253518da18420e6cd (patch) | |
| tree | 358cdee3a8c412eb22ee52c2437d8f151ef2627b /sway/commands.c | |
| parent | ae7ed795730398d50e6408575a1edfbd5c34bd3c (diff) | |
cmd_output: Merge instead of replace output config
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) {  	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, | 
