diff options
author | 2023-02-20 18:56:43 +0100 | |
---|---|---|
committer | 2023-02-22 10:14:31 -0500 | |
commit | 423459723bc488b69aa6fafcc9aa4e13fdf92717 (patch) | |
tree | 5df50f9f14a7f9f0238f5eef6f9043a4717b2bee | |
parent | Implement seatop_touch (diff) | |
download | sway-423459723bc488b69aa6fafcc9aa4e13fdf92717.tar.gz sway-423459723bc488b69aa6fafcc9aa4e13fdf92717.tar.zst sway-423459723bc488b69aa6fafcc9aa4e13fdf92717.zip |
Adjust scale for fractional-scale-v1
-rw-r--r-- | sway/config/output.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/config/output.c b/sway/config/output.c index e2e48e4c..3b524433 100644 --- a/sway/config/output.c +++ b/sway/config/output.c | |||
@@ -460,6 +460,16 @@ static void queue_output_config(struct output_config *oc, | |||
460 | float scale; | 460 | float scale; |
461 | if (oc && oc->scale > 0) { | 461 | if (oc && oc->scale > 0) { |
462 | scale = oc->scale; | 462 | scale = oc->scale; |
463 | |||
464 | // The factional-scale-v1 protocol uses increments of 120ths to send | ||
465 | // the scale factor to the client. Adjust the scale so that we use the | ||
466 | // same value as the clients'. | ||
467 | float adjusted_scale = round(scale * 120) / 120; | ||
468 | if (scale != adjusted_scale) { | ||
469 | sway_log(SWAY_INFO, "Adjusting output scale from %f to %f", | ||
470 | scale, adjusted_scale); | ||
471 | scale = adjusted_scale; | ||
472 | } | ||
463 | } else { | 473 | } else { |
464 | scale = compute_default_scale(wlr_output, pending); | 474 | scale = compute_default_scale(wlr_output, pending); |
465 | sway_log(SWAY_DEBUG, "Auto-detected output scale: %f", scale); | 475 | sway_log(SWAY_DEBUG, "Auto-detected output scale: %f", scale); |