New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wayland: add wp-fractional-scale-v1 support #10943
wayland: add wp-fractional-scale-v1 support #10943
Conversation
c4ed894
to
ea28f04
Compare
Unfortunately, it's pretty trivial to trigger some "off-by-one" errors in the window dimensions in certain cases (playing around with |
ea28f04
to
c1bccd7
Compare
This seems to do the trick. This now depends on wayland-protocols 1.31. Seems to behave OK in the fractional-scale support case while still working the same as before without it. I'll try to rig up multi monitors later to do some more testing. |
c1bccd7
to
1c7710f
Compare
9f07371
to
ad2218b
Compare
33c9b48
to
37e67a7
Compare
This is going to be the greatest clusterfuck I've ever written. Did some more testing with multimonitors on Plasma (built from an arbitrary git commit from master) as well as my rebased Sway/wlroots branch. Tweaked some things, and in general it seems to work. This is insanely complicated though (was already bad enough before), but there's really nothing I can do about it. There's so many different ways to scale now and I can't just drop the I'm sure there's regressions, but anyways I'll think on it for a few more days before merging so people out there can actually use the thing (the next KDE release will drop soonish with this) and report breakage. |
This is in preparation for fractional scaling support. Basically, redo all the coordinates in wayland so that wl->geometry is equal exactly to what is being put out to the screen (no extra wl->scaling multiplication required). The wl->vdparams variable is also eliminated for simplicity. This changes mpv's behavior on wayland with hidpi scaling but that will be addressed in more detail with the next commit.
502aff8
to
cc93fb6
Compare
Okay, I don't think I hate this anymore after this third rewrite. |
e1c17fd
to
e155e55
Compare
This protocol is pretty important since it finally lets us solve the longstanding issue of fractional scaling in wayland (no more mpv doing rendering over the target resolution and then being scaled down). This protocol also can completely replace the buffer_scale usage that we are currently using for integer scaling so hopefully this can be removed sometime in the future. Note that vo_dmabuf_wayland is omitted from the fractional scale handling because we want the compositor to handle all the scaling for that VO. Fixes mpv-player#9443.
e155e55
to
a3f3813
Compare
Great job and well done! 🥳 and high five ✋ as I have basically just completed 3rd rewrite of some KDE Dolphin related stuff aswell 😅 just few bugs left to fix before submitting MR :) |
Currently depends on wayland-protocols from master. Presumably they'll cut a new release soon though since this is a pretty major feature.Now depends on wayland-protocols 1.31.Tested this on sway/wlroots with https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3511 and swaywm/sway#6929 (with the later rebased/cherry-picked locally). Seems to work as desired and fortunately it's not nearly as invasive into mpv's geometry handling as I initially feared.
This does sort of change the semantics of how mpv on wayland handles HiDPI but it's actually more inline with other platforms now. Basically, the window is always scaled by the extra scale factor. Previously, it was always shown as the exact pixel size with no extra scaling.
Eventually, I'd like to eliminate the old
buffer_scale
codepath and logic completely because the fractional scale protocol is simply better in every way, but that will have to wait for the future so for now we have to juggle these three different cases (fractional scale, regular wayland integer scaling, and no scaling at all).TODO:
--no-hidpi-window-scale
option with the fractional scale methodFixes #9443.