Skip to content

Draft: monitor-manager: Don't use excessively precise scales

Adrian Vovk requested to merge AdrianVovk/mutter:no-precise-scale-factors into main

This MR is incomplete, but I'm not going to continue work on it until I hear back from you whether or not it is worth pursuing. Sure, with this patch Mutter's behavior is, strictly speaking, "more correct", but I don't know of any issues caused by the current behavior. Let me know your thoughts!


Sometimes, when a scale factor calculation becomes too precise, Mutter ends up choosing a scale factor that doesn't actually cleanly divide the resolution. After the 0.0001 decimal place, changes in the scale factor correspond to less than one pixel of resolution, so it doesn't make sense to find scale factors more precise than that.

For instance, on my 2560x1600 Macbook, Mutter ends up claiming that 1.502347469329834 is a valid scale factor. Clearly, this number doesn't cleanly divide 2560. With this patch, instead of pursuing an infinitely more precice number that's closer to 1.5, Mutter selects a much more appropriate scale factor of 1.6

Edited by Adrian Vovk

Merge request reports