diff options
author | Simon Ser <contact@emersion.fr> | 2020-02-11 14:23:29 +0100 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2020-02-11 20:52:02 -0500 |
commit | 47763c99f931daeb19fb6aba84bd60a22e9bd985 (patch) | |
tree | be93edd964bf720de72f5dd2aea963fe346f8653 | |
parent | f5fa0c7124dde3438a22550aae017f824d20c93b (diff) |
Apply the output scale filter after the output commit
The smart output filter uses the current output scale.
-rw-r--r-- | sway/config/output.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index 73d62aff..26d40f3e 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -361,26 +361,6 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { output->current_mode = wlr_output->pending.mode; } - if (oc) { - enum scale_filter_mode scale_filter_old = output->scale_filter; - switch (oc->scale_filter) { - case SCALE_FILTER_DEFAULT: - case SCALE_FILTER_SMART: - output->scale_filter = ceilf(wlr_output->scale) == wlr_output->scale ? - SCALE_FILTER_NEAREST : SCALE_FILTER_LINEAR; - break; - case SCALE_FILTER_LINEAR: - case SCALE_FILTER_NEAREST: - output->scale_filter = oc->scale_filter; - break; - } - if (scale_filter_old != output->scale_filter) { - sway_log(SWAY_DEBUG, "Set %s scale_filter to %s", oc->name, - sway_output_scale_filter_to_string(output->scale_filter)); - output_damage_whole(output); - } - } - if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) { sway_log(SWAY_DEBUG, "Set %s subpixel to %s", oc->name, sway_wl_output_subpixel_to_string(oc->subpixel)); @@ -416,6 +396,26 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) { return false; } + if (oc) { + enum scale_filter_mode scale_filter_old = output->scale_filter; + switch (oc->scale_filter) { + case SCALE_FILTER_DEFAULT: + case SCALE_FILTER_SMART: + output->scale_filter = ceilf(wlr_output->scale) == wlr_output->scale ? + SCALE_FILTER_NEAREST : SCALE_FILTER_LINEAR; + break; + case SCALE_FILTER_LINEAR: + case SCALE_FILTER_NEAREST: + output->scale_filter = oc->scale_filter; + break; + } + if (scale_filter_old != output->scale_filter) { + sway_log(SWAY_DEBUG, "Set %s scale_filter to %s", oc->name, + sway_output_scale_filter_to_string(output->scale_filter)); + output_damage_whole(output); + } + } + // Find position for it if (oc && (oc->x != -1 || oc->y != -1)) { sway_log(SWAY_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); |