mirror of
https://github.com/brl/mutter.git
synced 2025-02-06 08:34:10 +00:00
d03dce4378
We want to avoid using too high scales too easily, which started to happen 2f1dd049bf ("monitor-manager: Rework default scale factor selection"). Instead of using the closest non-fractional scale, which effectively is what we'd do, only round upwards if we're closer than 0.25 (25%). Since there are some wiggle room for scales to make the logical resolution on the integer pixel grid, make sure to compensate. This compensation is done by adding an extra 0.2 to scale difference. For example the following fractional scales will get these corresponding integer scales: * 1.25 -> 1.0 * 1.5 -> 1.0 * 1.75 -> 2.0 * 2.0 -> 2.0 * 2.50 -> 2.0 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2880>