diff options
author | 2017-12-06 19:16:12 +0100 | |
---|---|---|
committer | 2017-12-06 19:16:12 +0100 | |
commit | 7c5d8c553cbf5e93538346c904f2c2e42af66c7c (patch) | |
tree | 7b6a7151cb1dee04cea0bff13ef27ba05ff2485d /sway | |
parent | Merge branch 'wlroots' into output-config (diff) | |
download | sway-7c5d8c553cbf5e93538346c904f2c2e42af66c7c.tar.gz sway-7c5d8c553cbf5e93538346c904f2c2e42af66c7c.tar.zst sway-7c5d8c553cbf5e93538346c904f2c2e42af66c7c.zip |
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) { | |||
25 | 25 | ||
26 | void merge_output_config(struct output_config *dst, struct output_config *src) { | 26 | void merge_output_config(struct output_config *dst, struct output_config *src) { |
27 | if (src->name) { | 27 | if (src->name) { |
28 | if (dst->name) { | 28 | free(dst->name); |
29 | free(dst->name); | ||
30 | } | ||
31 | dst->name = strdup(src->name); | 29 | dst->name = strdup(src->name); |
32 | } | 30 | } |
33 | if (src->enabled != -1) { | 31 | if (src->enabled != -1) { |
@@ -55,15 +53,11 @@ void merge_output_config(struct output_config *dst, struct output_config *src) { | |||
55 | dst->transform = src->transform; | 53 | dst->transform = src->transform; |
56 | } | 54 | } |
57 | if (src->background) { | 55 | if (src->background) { |
58 | if (dst->background) { | 56 | free(dst->background); |
59 | free(dst->background); | ||
60 | } | ||
61 | dst->background = strdup(src->background); | 57 | dst->background = strdup(src->background); |
62 | } | 58 | } |
63 | if (src->background_option) { | 59 | if (src->background_option) { |
64 | if (dst->background_option) { | 60 | free(dst->background_option); |
65 | free(dst->background_option); | ||
66 | } | ||
67 | dst->background_option = strdup(src->background_option); | 61 | dst->background_option = strdup(src->background_option); |
68 | } | 62 | } |
69 | } | 63 | } |
@@ -103,7 +97,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { | |||
103 | } | 97 | } |
104 | if (oc && oc->scale > 0) { | 98 | if (oc && oc->scale > 0) { |
105 | sway_log(L_DEBUG, "Set %s scale to %d", oc->name, oc->scale); | 99 | sway_log(L_DEBUG, "Set %s scale to %d", oc->name, oc->scale); |
106 | wlr_output->scale = oc->scale; | 100 | wlr_output_set_scale(wlr_output, oc->scale); |
107 | } | 101 | } |
108 | if (oc && oc->transform >= 0) { | 102 | if (oc && oc->transform >= 0) { |
109 | sway_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform); | 103 | sway_log(L_DEBUG, "Set %s transform to %d", oc->name, oc->transform); |