mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 11:21:28 +00:00
Adjust scale for fractional-scale-v1
This commit is contained in:
parent
4666d1785b
commit
423459723b
|
@ -460,6 +460,16 @@ static void queue_output_config(struct output_config *oc,
|
||||||
float scale;
|
float scale;
|
||||||
if (oc && oc->scale > 0) {
|
if (oc && oc->scale > 0) {
|
||||||
scale = oc->scale;
|
scale = oc->scale;
|
||||||
|
|
||||||
|
// The factional-scale-v1 protocol uses increments of 120ths to send
|
||||||
|
// the scale factor to the client. Adjust the scale so that we use the
|
||||||
|
// same value as the clients'.
|
||||||
|
float adjusted_scale = round(scale * 120) / 120;
|
||||||
|
if (scale != adjusted_scale) {
|
||||||
|
sway_log(SWAY_INFO, "Adjusting output scale from %f to %f",
|
||||||
|
scale, adjusted_scale);
|
||||||
|
scale = adjusted_scale;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
scale = compute_default_scale(wlr_output, pending);
|
scale = compute_default_scale(wlr_output, pending);
|
||||||
sway_log(SWAY_DEBUG, "Auto-detected output scale: %f", scale);
|
sway_log(SWAY_DEBUG, "Auto-detected output scale: %f", scale);
|
||||||
|
|
Loading…
Reference in a new issue