mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Simplify free calls, use wlr_output_set_scale
This commit is contained in:
		
							parent
							
								
									c25ad5e7c4
								
							
						
					
					
						commit
						7c5d8c553c
					
				
					 1 changed files with 4 additions and 10 deletions
				
			
		| 
						 | 
					@ -25,9 +25,7 @@ void output_config_defaults(struct output_config *oc) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void merge_output_config(struct output_config *dst, struct output_config *src) {
 | 
					void merge_output_config(struct output_config *dst, struct output_config *src) {
 | 
				
			||||||
	if (src->name) {
 | 
						if (src->name) {
 | 
				
			||||||
		if (dst->name) {
 | 
							free(dst->name);
 | 
				
			||||||
			free(dst->name);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		dst->name = strdup(src->name);
 | 
							dst->name = strdup(src->name);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (src->enabled != -1) {
 | 
						if (src->enabled != -1) {
 | 
				
			||||||
| 
						 | 
					@ -55,15 +53,11 @@ void merge_output_config(struct output_config *dst, struct output_config *src) {
 | 
				
			||||||
		dst->transform = src->transform;
 | 
							dst->transform = src->transform;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (src->background) {
 | 
						if (src->background) {
 | 
				
			||||||
		if (dst->background) {
 | 
							free(dst->background);
 | 
				
			||||||
			free(dst->background);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		dst->background = strdup(src->background);
 | 
							dst->background = strdup(src->background);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (src->background_option) {
 | 
						if (src->background_option) {
 | 
				
			||||||
		if (dst->background_option) {
 | 
							free(dst->background_option);
 | 
				
			||||||
			free(dst->background_option);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		dst->background_option = strdup(src->background_option);
 | 
							dst->background_option = strdup(src->background_option);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -103,7 +97,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (oc && oc->scale > 0) {
 | 
						if (oc && oc->scale > 0) {
 | 
				
			||||||
		sway_log(L_DEBUG, "Set %s scale to %d", oc->name, oc->scale);
 | 
							sway_log(L_DEBUG, "Set %s scale to %d", oc->name, oc->scale);
 | 
				
			||||||
		wlr_output->scale = oc->scale;
 | 
							wlr_output_set_scale(wlr_output, oc->scale);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (oc && oc->transform >= 0) {
 | 
						if (oc && oc->transform >= 0) {
 | 
				
			||||||
		sway_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform);
 | 
							sway_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue