this post was submitted on 09 Jan 2024
103 points (93.3% liked)

Linux

48323 readers
637 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] BananaTrifleViolin@lemmy.world 91 points 10 months ago* (last edited 10 months ago)

The actual answer in on Stack exchange in their comments.

https://unix.stackexchange.com/questions/740319/why-is-gnome-fractional-scaling-1-7518248558044434-instead-of-1-75

It is related to a mix of actual display resolution vs conversions to virtual resolutions (the scaled resolution), and use of single precision floating point calculations.

Essentially my understanding is what it is doing is storing the value needed to convert your actual resolutions number of pixels (2160p) to a virtual resolution number of pixels (2160/1.75 horizontally) but that gets you fractions of a virtual pixel. So instead of 1.75 it scaled by 1.75182... to get to a whole number of virtual pixels to work with. Then on top of that the figure is slightly altered from what we'd expect by floating point errors.

If you take the actual horizontal resolution 2190 and divide it by the virtual resolution it's trying to use 1233 pixels, you need a conversion value of 1.75182.... to convert to it so you don't get fractions of a pixel. If you used 1.75 you'd get 1234.2857... pixels. So gnome is storing the fraction that gets you a clean conversion in pixels to about 4 decimal places of a pixel.

Full credit to rakslice at Stack Exchange who also goes into the detail.