Blury Interface with Gnome Wayland and fractional scaling

Hi, this is not an issue isolated to anki, but i think more generally to Qt-Apps with Wayland and fractional scaling.

I have a somewhat unusual Display Resolution (2256x1504@13.5 inches) and therefore somewhat a HiDPI screen. This means for a useable interface i use a fractional scaling of 150%. Unfortunately this results in a blurry interface with qt-apps like KeePassXC or Anki. I guess this is because of Wayland and maybe XWayland. It would be really nice if the Anki developers could see if they can get a native Wayland support and if this would resolve the Issue. Programs like firefox, thunderbird or TLP-UI don’t have this issue.

Appended is a screenshot that should help explain the issue better.

System information:
Manjaro Gnome 41.5
Kernel 5.17
Wayland
Screen 2256x1504 with Scaling 150%
Graphics Mesa Intel

Anki 2.1.50 (26d40c3a) Python 3.10.4 Qt 6.2.3 PyQt 6.2.3
also tested with 2.1.49, makes no difference

Is this bug on the aggenda or is there some known workaround for this? Maybe turn of the scaling for this program specifically and use the anki internal upscaling?

You can force wayland mode with QT_QPA_PLATFORM=wayland ANKI_WAYLAND=1 in a terminal. If it does not help, it’s doubtful there is anything Anki can do about it.

2 Likes

It does indeed help with the sharpness of the interface, it looks very good. Unfortunately Anki is otherwise unusable, window title bar doesn’t render correctly and the full screen mode shows no window at all, but is transparent instead.

But thank you for your answer.

The transparent space in the second screenshot does in reality also show the desktop, it is, you could say, transparent.

I can confirm the second issue and have added it to the issue tracker: Wayland issues · Issue #1767 · ankitects/anki · GitHub

Also, for me the Qt5 build requires setting QT_QPA_PLATFORM=wayland ANKI_WAYLAND=1 whereas Qt6 doesn’t.

1 Like

Hi! Sorry for reviving this thread. Are there any plans on better wayland support in the future? Launching anki with QT_QPA_PLATFORM=wayland ANKI_WAYLAND=1 works for fractional scaling, but as indicated in the manual, the application looses its borders (at least for me on Fedora). Are there any workarounds to fix this? Any input would be appreciated! Thanks.

I got my sights on creating client-side window decorations (i.e. custom window design specific to Anki) to support DEs that don’t allow server-side decorations. As a GNOME user I’m affected as well and I’d love to have that hi-dpi support at some point.

CSD would fix the missing border/drop shadow issue and open the door for more creative UI than just a menu bar. However, it would apply to all systems. There is no way to do it for Wayland Linux only.

To me a cross-platform consistent look is preferable anyway (provided it’s a good design), but @dae has expressed some reservations about custom designs (e.g. scrollbar in #1989). Anki’s current approach is to make the app look and feel native to the system it runs on.

TL;DR: it’s difficult and will take some time - but it’s the first project I’d take up once I’m finished with editor-, theme-, and main window updates - if I get the Go for that.

1 Like

Thanks a lot for the transparent and quick response on this. It’s good to know that you are actively working on this and I can understand both views on CSD, but I’m sure you’ll come to an agreeable solution. Thanks for the work on the app, it’s very much appreciated.

This is particularly difficult for Wayland as Gnome is far from being the only DE / WM that runs on Wayland, and that there is a wide variety on how the borders are shown. Just to give you an example, this is what it looks like on mine (Sway)