Open whitequark opened 5 months ago
I've submitted https://github.com/ngscopeclient/scopehal-apps/pull/725 as an example of how to make DPI scaling determination work pretty okay on X11 Linux, but it still needs to be tested on Wayland Linux, Windows, and macOS. Personally I'm willing to do that once the ffts dependency is no longer something I have to build.
Scaling also seems to be completely broken on Wayland. (Sway)
I am not sure if cause is also GLFW
I have a hack (temporary "solution") that might help some people.
It does seem to at least fix cursor alignment to buttons and to render with reasonable resolution
gamescope -W 1440 -H 900 -r 60 -- ngscopeclient
I have the same issue on wayland (sway).
gamescope
also does not work because of an issue with my intel integrated GPU.
As a workaround I use Xwayland using XDG_SESSION_TYPE=x11
.
This works fine for me but I am using the default scale of 1 / DPI of 96.
This happens because it uses GLFW and GLFW currently retrieves content scale via "folklore heuristics" (their words) which do not really work: https://github.com/glfw/glfw/blob/b35641f4a3c62aa86a0b3c983d163bc0fe36026d/src/x11_init.c#L990-L1023
On X11 there's no unified way to do this. The best you could do in a fully arch-independent manner is to query RandR display DPI, but that's kind of a pain to do. An alternative is to look at GDK/Qt environment variables.