aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2020-02-11 14:23:29 +0100
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2020-02-11 20:52:02 -0500
commit47763c99f931daeb19fb6aba84bd60a22e9bd985 (patch)
treebe93edd964bf720de72f5dd2aea963fe346f8653 /sway/config
parentStop calling apply_output_config from output_enable (diff)
downloadsway-47763c99f931daeb19fb6aba84bd60a22e9bd985.tar.gz
sway-47763c99f931daeb19fb6aba84bd60a22e9bd985.tar.zst
sway-47763c99f931daeb19fb6aba84bd60a22e9bd985.zip
Apply the output scale filter after the output commit
The smart output filter uses the current output scale.
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/output.c40
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) {
361 output->current_mode = wlr_output->pending.mode; 361 output->current_mode = wlr_output->pending.mode;
362 } 362 }
363 363
364 if (oc) {
365 enum scale_filter_mode scale_filter_old = output->scale_filter;
366 switch (oc->scale_filter) {
367 case SCALE_FILTER_DEFAULT:
368 case SCALE_FILTER_SMART:
369 output->scale_filter = ceilf(wlr_output->scale) == wlr_output->scale ?
370 SCALE_FILTER_NEAREST : SCALE_FILTER_LINEAR;
371 break;
372 case SCALE_FILTER_LINEAR:
373 case SCALE_FILTER_NEAREST:
374 output->scale_filter = oc->scale_filter;
375 break;
376 }
377 if (scale_filter_old != output->scale_filter) {
378 sway_log(SWAY_DEBUG, "Set %s scale_filter to %s", oc->name,
379 sway_output_scale_filter_to_string(output->scale_filter));
380 output_damage_whole(output);
381 }
382 }
383
384 if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) { 364 if (oc && (oc->subpixel != WL_OUTPUT_SUBPIXEL_UNKNOWN || config->reloading)) {
385 sway_log(SWAY_DEBUG, "Set %s subpixel to %s", oc->name, 365 sway_log(SWAY_DEBUG, "Set %s subpixel to %s", oc->name,
386 sway_wl_output_subpixel_to_string(oc->subpixel)); 366 sway_wl_output_subpixel_to_string(oc->subpixel));
@@ -416,6 +396,26 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
416 return false; 396 return false;
417 } 397 }
418 398
399 if (oc) {
400 enum scale_filter_mode scale_filter_old = output->scale_filter;
401 switch (oc->scale_filter) {
402 case SCALE_FILTER_DEFAULT:
403 case SCALE_FILTER_SMART:
404 output->scale_filter = ceilf(wlr_output->scale) == wlr_output->scale ?
405 SCALE_FILTER_NEAREST : SCALE_FILTER_LINEAR;
406 break;
407 case SCALE_FILTER_LINEAR:
408 case SCALE_FILTER_NEAREST:
409 output->scale_filter = oc->scale_filter;
410 break;
411 }
412 if (scale_filter_old != output->scale_filter) {
413 sway_log(SWAY_DEBUG, "Set %s scale_filter to %s", oc->name,
414 sway_output_scale_filter_to_string(output->scale_filter));
415 output_damage_whole(output);
416 }
417 }
418
419 // Find position for it 419 // Find position for it
420 if (oc && (oc->x != -1 || oc->y != -1)) { 420 if (oc && (oc->x != -1 || oc->y != -1)) {
421 sway_log(SWAY_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y); 421 sway_log(SWAY_DEBUG, "Set %s position to %d, %d", oc->name, oc->x, oc->y);