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

Hidpi support in X11 #4176

Closed
realh opened this issue Mar 11, 2021 · 3 comments
Closed

Hidpi support in X11 #4176

realh opened this issue Mar 11, 2021 · 3 comments
Milestone

Comments

@realh
Copy link

realh commented Mar 11, 2021

The X11 backend doesn't seem to support hidpi yet, but Wayland does. It would be useful if SDL could support hidpi on X11, because there there are lots of obstacles to gamers adopting Wayland, including #3739.

@icculus
Copy link
Collaborator

icculus commented Mar 19, 2021

I can't find clear guidance on what needs to be done for this. Was this all built at the Gnome and KDE level, and toolkits talking directly to X11 are out of luck?

I assume we need a way to broadcast "we can cooperate in a HiDPI environment" to the system and then report correct (scaled) values for window size, mouse coordinates, SDL_GL_GetDrawableSize, etc. but I need information on how this works in current times at the X11 level.

@realh
Copy link
Author

realh commented Mar 19, 2021

I think it is done at the toolkit level with a user option, eg GNOME/GTK3 has a dconf setting, Qt and GTK2 have environment variables. In theory you should be able to query the X server to at least be able to calculate the DPI and decide on appropriate scaling, but the information can be highly unreliable. For example, ISTR my previous TV, a Sony, reported its dimensions as 16m x 9m!

I don't suppose you'd want to link SDL with dconf, so having its own environment variable would probably be the best way forwards.

@slouken
Copy link
Collaborator

slouken commented May 20, 2023

This is now implemented for SDL 3.0.

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