diff options
author | emersion <contact@emersion.fr> | 2017-12-06 19:16:12 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-12-06 19:16:12 +0100 |
commit | 7c5d8c553cbf5e93538346c904f2c2e42af66c7c (patch) | |
tree | 7b6a7151cb1dee04cea0bff13ef27ba05ff2485d /sway | |
parent | c25ad5e7c4dc49cdcda23c25558253e77be8894a (diff) |
Simplify free calls, use wlr_output_set_scale
Diffstat (limited to 'sway')
-rw-r--r-- | sway/config/output.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index 4ed2c531..4a0a5cc9 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -25,9 +25,7 @@ void output_config_defaults(struct output_config *oc) { void merge_output_config(struct output_config *dst, struct output_config *src) { if (src->name) { - if (dst->name) { - free(dst->name); - } + free(dst->name); dst->name = strdup(src->name); } if (src->enabled != -1) { @@ -55,15 +53,11 @@ void merge_output_config(struct output_config *dst, struct output_config *src) { dst->transform = src->transform; } if (src->background) { - if (dst->background) { - free(dst->background); - } + free(dst->background); dst->background = strdup(src->background); } if (src->background_option) { - if (dst->background_option) { - free(dst->background_option); - } + free(dst->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) { 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) { sway_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform); |