logged.

<< back to post overview

Display KeepassXC (aka QT5 apps) properly on HiDPI with fractional scaling

I recently received my 13 inch Framwork AMD edition which runs nearly flawlessly with Arch Linux. Its major drawback is the need for fractional scaling with the current display for a pleasant viewing experience. At the time of writing this is still an experimental feature for many desktop environments and UI frameworks.
After enabling experimental fractional scaling support for GNOME 45.2 (on Wayland) I experienced some QT applications rendering badly, which especially bothered me with KeepassXC.

Lucky enough the solution was only one magical environment variable away: QT_QPA_PLATFORM=wayland.
After setting it locally in my shell (set -x QT_QPA_PLATFORM wayland on fish) and running keepassxc to verify it is working, I added the variable to the corresponding .desktop file aswell.
On Arch Linux, this starts with copying the system-wide KeepassXC .desktop file to the users local location (cp /usr/share/applications/org.keepassxc.KeePassXC.desktop ~/.local/share/applications/) to keep the changes after upgrades. After that, opening the local version and changing the Exec line to the following results in KeepassXC to start with crisp font rendering and UI: Exec=env QT_QPA_PLATFORM=wayland keepassxc %f.

Hope this helps ✌.