From 47763c99f931daeb19fb6aba84bd60a22e9bd985 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 11 Feb 2020 14:23:29 +0100 Subject: [PATCH] Apply the output scale filter after the output commit The smart output filter uses the current output scale. --- sway/config/output.c | 40 ++++++++++++++++++++-------------------- 1 file 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);