ripose-jp / Memento

An mpv-based video player for studying Japanese
https://ripose-jp.github.io/Memento/
GNU General Public License v2.0
434 stars 21 forks source link

Partially visible video when using display scaling #221

Open Meth69 opened 1 month ago

Meth69 commented 1 month ago

Hello, I'd like to report a bug with Memento v1.3.0 from the AUR. I'm using Arch linux on a laptop, when using display scaling in the system settings the video in Memento is cut, only 1/4 of the video is visible, only the bottom-left part of it. When removing display scaling and bringing it back to 100% the video plays fine. When using a high-dpi display it's often useful to have display scaling enabled and this interferes with Memento video playback, hopefully it can be fixed. Thanks.

ripose-jp commented 1 month ago

Unfortunately I'm not able to reproduce this. The closest I can get is on macOS where if the video is paused and is moved between displays with different DPI scaling, the video is broken in a way similar to how your describe. Unpausing it immediately fixes it though, which leads me to believe this is a different bug. On Linux I don't see any such bug with a single display set to any level of DPI scaling using Plasma 5.

What is your desktop environment and DPI scaling settings?

Meth69 commented 1 month ago

I'm using Plasma 6.0.4 and a 105% DPI scaling (very minimal scaling, but I have tried with other values and all seem to have the same effect).

ripose-jp commented 1 month ago

I don't think this is a Memento bug, but is instead somewhere upstream. Forgive me, but this explanation is going to have to get into the weeds a bit.

I was able to reproduce this bug in a KDE Neon VM at 125% DPI scaling. Stepping through the relevant code in GDB, I can see that QScreen::devicePixelRatio() is returning a value of 2 for any DPI scaling factor above 100%. If DPI scaling is set to 125%, the value returned should be 1.25. This is the crux of the issue.

I can't reproduce this on my own computer using Plasma 5 with X11 and Qt6. This leads me to believe this could be a bug in Qt6 on Wayland, but that's difficult to test for without setting up more VMs. The other alternative is this bug comes from Plasma 6 somehow. I don't know how QScreen::devicePixelRatio() is implemented, but it probably has to interact with Plasma somehow to know what scaling is set. I think this being a bug in Plasma 6 generally is more likely since it's the newer, less stable software compared to Qt6.

Unfortunately I can't fix this. It needs to be reported upstream.

Meth69 commented 1 month ago

I see, thanks for checking it out, for now I'll just disable DPI scaling. Thanks for making this invaluable study tool :)