[wayland] Implement fractional-scale-v1 protocol support for fractional scaling
Categories
(Core :: Widget: Gtk, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox118 | --- | fixed |
People
(Reporter: rmader, Assigned: emilio)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
The new protocol (still draft) at https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511 allows compositors to tell us the optimal fractional scale to use with the already existing fractional scaling implementation (currently using the about:config
value widget.wayland.fractional_buffer_scale
). Having Firefox builds should help with the upstreaming process.
Should not be merged until the protocol is upstreamed.
Reporter | ||
Comment 1•3 years ago
|
||
Comment hidden (off-topic) |
Comment 3•3 years ago
|
||
Sorry, there was a problem with the detection of inactive users. I'm reverting the change.
Reporter | ||
Comment 5•2 years ago
|
||
The protocol landed now, see https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/4624cfaaf563cd7be5e2e2087c8de6d3a48ea867/staging/fractional-scale/fractional-scale-v1.xml
Hope to get around to implement this soon.
Updated•2 years ago
|
Reporter | ||
Comment 6•2 years ago
|
||
Just updated the patch - it should work now if you use a compositor supporting the protocol (minus bugs). The about:config
switch changed to a simple widget.wayland.fractional-scale.enabled
bool.
Will need a bit more refining, then we should be able to land it.
Comment 7•2 years ago
|
||
Robert, how is that integrated with our current Gtk code? AFAIK Gtk uses fixed scales (1,2,3..) and then the frame buffer is scaled by compositor, right? So we paint only the fixed scales to the surfaces. So is there any benefit here or does it help somehow?
Updated•2 years ago
|
Reporter | ||
Comment 8•2 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #7)
Robert, how is that integrated with our current Gtk code? AFAIK Gtk uses fixed scales (1,2,3..) and then the frame buffer is scaled by compositor, right? So we paint only the fixed scales to the surfaces. So is there any benefit here or does it help somehow?
This would be independent from GTK. As we create/control the (subsurface) buffer ourselves, we can use this protocol and vp_viewporter to determine an optimal buffer size which is both more performant and and many cases also sharper.
Quick example of bandwidth on a 1920x1080 @ 125% screen. The number of pixels painted on a fullscreen repaint:
- integer scaling: (1536 x 2) x (864 x 2) = 5308416
- fractional scaling: 1920 x 1080 = 2073600
2073600 / 5308416 = 0,390625 -> 60% reduction in pixel painted.
125% (and smaller values) are the most extreme though.
Comment 9•2 years ago
|
||
KDE does actually allow you to pick a value as low as 105%
Comment 10•1 years ago
|
||
The fractional_scale_v1 protocol has been stabilised and released in wayland-protocols 1.32.
A few compositors already have support, albeit no stable releases yet.
Comment 11•1 years ago
|
||
A few compositors already have support, albeit no stable releases yet.
It was released in Plasma 5.27, no?
Comment 12•1 years ago
|
||
(In reply to equeim from comment #11)
A few compositors already have support, albeit no stable releases yet.
It was released in Plasma 5.27, no?
Yeah, it was
Reporter | ||
Comment 13•1 years ago
|
||
It's also supported in Gnome 44.
Comment 14•1 years ago
|
||
So mast of the Linux desktop space has support then
Comment 15•1 years ago
|
||
*most (wish this site had an edit feature...)
Assignee | ||
Comment 16•1 years ago
|
||
Robert, do you have any plans to rebase and maybe land the patch? I think having it in-tree at least in an experimental fashion would be good.
Alternatively I can try to poke. I added support for drawing scaled-down GTK widgets a while ago so I don't think the gtk integer scale would be an issue, necessarily.
Comment 17•1 years ago
|
||
wp_fractional_scale_manager_v1 seems to be present on Gnome/Fedora 38.
Reporter | ||
Comment 18•1 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #16)
Robert, do you have any plans to rebase and maybe land the patch? I think having it in-tree at least in an experimental fashion would be good.
Would love to, but unfortunately I'm quite busy (with related work in Mutter) atm :(
Alternatively I can try to poke. I added support for drawing scaled-down GTK widgets a while ago so I don't think the gtk integer scale would be an issue, necessarily.
Would love to see that!
Assignee | ||
Comment 19•1 years ago
|
||
Ok, let me add it to my queue of things to poke at when I have the time :)
Assignee | ||
Comment 20•1 years ago
|
||
Use C++ constructor/destructors to deal with MozContainer state, which makes
stuff a bit simpler to reason about, and a bit more correct.
For example we were relying on an std::vector<> allocated via calloc() being
correct, which seems to hold but it's UB and a bit sketchy.
Assignee | ||
Comment 21•1 years ago
|
||
This is a manually-rebased version of D145169, but with the protocol
header regenerated, various fixes and tweaks.
In particular we only check the pref once when asking for the protocol
now, the rest falls through from current_fractional_scale being 0.0.
I gave it a shot on KWin and stuff seems to work properly, but let's
keep it disabled by default for now and maybe enable on a separate bug.
Depends on D186198
Assignee | ||
Updated•1 years ago
|
Assignee | ||
Updated•1 years ago
|
Assignee | ||
Updated•1 years ago
|
Comment 22•1 years ago
|
||
Comment 23•1 years ago
|
||
Backed out for nsTArray_base crashes
Backout link: https://hg.mozilla.org/integration/autoland/rev/e20f92633534c049eecb9e49bf7860cd506b2abf
Log link: https://treeherder.mozilla.org/logviewer?job_id=426018935&repo=autoland&lineNumber=6648
Assignee | ||
Updated•1 years ago
|
Comment 24•1 years ago
|
||
Comment 25•1 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/13a48c068860
https://hg.mozilla.org/mozilla-central/rev/c01858a20255
https://hg.mozilla.org/mozilla-central/rev/c97a1a56c617
Description
•