Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPI scaling is incorrectly determined on X11 Linux #724

Open
whitequark opened this issue Jun 23, 2024 · 3 comments
Open

DPI scaling is incorrectly determined on X11 Linux #724

whitequark opened this issue Jun 23, 2024 · 3 comments

Comments

@whitequark
Copy link
Contributor

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.

@whitequark
Copy link
Contributor Author

whitequark commented Jun 23, 2024

I've submitted #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.

@nemanjan00
Copy link

nemanjan00 commented Jul 1, 2024

Scaling also seems to be completely broken on Wayland. (Sway)

I am not sure if cause is also GLFW

20240701_13h47m09s_grim
20240701_13h47m25s_grim

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

20240701_13h53m47s_grim

@MonarchActual
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants