-
Notifications
You must be signed in to change notification settings - Fork 950
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
[x11-backend] Retrieve DPI from Xft.dpi XResource #606
Conversation
How does this work with respect to multiple monitors / mixed DPI? |
It doesn't. It is a global override of DPI setting. Both GLFW and QT use it as such. |
Alright, and this won't regress mixed DPI for people who don't have this var set? |
Just hit this issue running my app in Ubuntu 18.04. I just checked and Xft.dpi is also set by GNOME's display settings. Can we get this merged then? |
Note that QT does support mixed DPI with multiple monitors similar to what winit is doing right now with a command line flag. I'm not sure if the Xft.dpi scaling is considered, but it would be possible to apply the Xft.dpi scaling on top of what winit has right now as a way to increase/decrease the scale globally, while the relation between monitors is calculated automatically to always be correct. |
I can confirm that this PR does fix the expected behaviour on my hidpi laptop, however I can't comment on the mixed-dpi behaviour as I don't have another monitor available to test on. |
https://github.com/tomaka/winit/blob/ddf133dd66c9bb1b1d98c3525f091539a5347222/src/dpi.rs#L53-L54 make sure to update these documentation lines! |
I'm definitely in favor of moving forward on this (and exploring that Qt multi-monitor stuff, though possibly not until a later PR) but it looks like @semtexzv isn't here anymore. Would anyone like to resurrect this PR? |
Closing, since the rebased version of this got merged. |
DPI Scaling on X11 is in rough shape. But I think calculating actual display DPI ourselves is not a way to go. The "Xft.dpi" XResource is at least somewhat standard on several linuxes ( Arch ). And is used in both GLFW and QT .
This commit changes the behavior of DPI scaling on X11. The primary value of DPI scaling factor is retrieved from Xft.dpi XResource. The previous behavior is used as a fallback option.
CHANGELOG.md
if knowledge of this change could be valuable to users