How fractional scaling works in Wayland?

Fractional scaling works by having the clients render at ceil(scale) where scale is the scale the monitor configured to. E.g. if you configure your monitor to 150 %, that in fact means a scaling factor of 1.5 and a HiDPI, clients will be told to render with a scaling factor of 2. What the compositor then does is take the over sized client buffer and paints it smaller on the target framebuffer.

The target framebuffer, i.e. the framebuffer that will be sent to the monitor, is not what is scaled, however, only clients buffers during composition. The same often applies to images that is part of the shell, as their source tend to only be available at certain sizes and we always pick e.g an icon that is at least as large as the result will be on the final framebuffer, which often means scaling down during composition too. The same applies to text, IIRC.

So for 1., yes for client buffers and most likely icons in the shell etc, but not painting in general, as we always paint to a framebuffer matching the monitor resolution.

For 2. - no, there is no fractional support in Wayland.

For 3. - no, GTK does not support non-integer scaled output.

For 4. - IIRC we use linear when the source dimension doesn’t match the target dimension.

4 Likes