If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Announcement
Collapse
No announcement yet.
GNOME 44 Mutter Adds fractional_scale_v1 Wayland Support
fractional_scale_v1 is not about the compositor scaling its about the compositor being able to put request to wayland application for X fractional scale if application say yes it can fractional scale at X scale then application itself renders at that scale. This can get around some scaling artifacts due to application side having more data.
Last time I looked gtk does not support fractional_scale_v1 newer versions of qt does. Hopefully gnome mutter having this feature that GTK will get support for it some point in future.
I literally just implemented fractional scaling in an app, and here's how exactly how it works:
* Use the wl_global callback to catch a fractional scaling manager. If one is given, your compositor supports fractional scaling. Also catch a viewporter manager.
* Create a wayland surface. Create a fractional scaling object for it. The compositor will notify if there's a fractional scale through callback.
* Create a buffer to attach to your surface. This needs to be the exact pixel size you want it.
* Apply a viewport object to your surface. Set the source dimensions to exactly your buffer size. Set the destination to your buffer size divided by the fractional scale. This will hopefully cause the surface to have a 1:1 pixel mapping. There's undefined behavior here with rounding.
Now, how I'd like this to work is:
Create a wayland surface. Create a buffer of your exact pixel size. Get rid of the viewporter and just call a function to request 1:1 pixels. If you're given the fractional scale, you can figure out what size of UI elements the user wants. You don't need anything but 1:1.
What a UI toolkit needs to do hidpi properly is to simple have freely scalable assets. We should have had this since the mid 2000's and vector themes were popular, but Gtk uses even more device-pixel specifics than it did before. Qt can mostly do it, but there's still tons of rounding errors between widgets.
My Manjaro installation just updated to GNOME 44.1 including mutter 44.1+r2+g82bd40dcbc-1 but XWayland windows are still blurry (I use a 4K display with 150% scaling).
Does anyone know if the changes made it into this version?
Comment