GNU+Linux HiDPI support
HiDPI and high-resolution displays are all over the place, and with prices constantly dropping, they are fast becoming ubiquitous.
However, GNU+Linux isn't quite ready for it. Well, actually, it may be, but the most popular desktop environment, GNOME, just... isn't.
Context
First, a little bit of context: I recently purchased a Framework 16 laptop, which has a 16", 2560x1600 display in the 16:10 aspect ratio. It's a good quality IPS panel that is capable of high refresh rates (up to 165 Hz), though not fast response times (9ms advertised). It also provides adequate brightness and contrast, at 500 nits and 1500:1 advertised as well. Colour is nothing special to note, and there's no HDR support, either.
My preferred laptop setup is the latest Ubuntu LTS, with either the Unity (when it existed) or GNOME desktop environment.
GTK
Symptom: 100% is too small, 200% is too large.
Fix: Enable fractional scaling, adjust scaling to 133% or 150%.
GDM
Symptom: too small.
It doesn't seem to pick up on the fractional scaling part of scaling. On my previous laptop, at 200% scale, it worked fine.
Fix: I can't find any. There are vague mentions of using machinectl to switch to the gdm user and change some gsettings, but that doesn't seem to work on Ubuntu. It could even be Arch-only!
Chrome
It Just Works™. I was a bit surprised by this one, but indeed it works by default, as it should. Thus, Electron-based apps should also Just Work™...
Visual Studio Code
Symptom: blurry.
Fix: Add launch flags to enable Ozone and use Wayland.
This can be done by a custom .desktop file:
# ~/.local/share/application/code-wayland.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=VSCode (Wayland)
Comment=Code Editing. Redefined.
Exec=/usr/bin/code --enable-features=UseOzonePlatform --ozone-platform=wayland %F
Icon=vscode
Categories=TextEditor;Development;IDE;
Keywords=vscode;
StartupNotify=true
StartupWMClass=Code
Actions=new-empty-window;
MimeType=text/plain;inode/directory;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/bin/code --enable-features=UseOzonePlatform --ozone-platform=wayland --new-window %F
Icon=com.visualstudio.code
Android Studio
Symptom: blurry.
Fix: Switch to rendering using Wayland.
# Menu bar -> Help -> Edit Custom VM Options...
-Dawt.toolkit.name=WLToolkit
The Flatpak version needs an override to connect the Wayland socket:
sudo flatpak override --socket=wayland com.google.AndroidStudio
Alternatively, use FlatSeal to adjust permissions.