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

[x11-backend] Retrieve DPI from Xft.dpi XResource #606

Closed
wants to merge 3 commits into from

Conversation

semtexzv
Copy link
Contributor

@semtexzv semtexzv commented Jul 19, 2018

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.

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created an example program if it would help users understand this functionality

@francesca64
Copy link
Member

How does this work with respect to multiple monitors / mixed DPI?

@semtexzv
Copy link
Contributor Author

It doesn't. It is a global override of DPI setting. Both GLFW and QT use it as such.

@francesca64
Copy link
Member

Alright, and this won't regress mixed DPI for people who don't have this var set?

@pedrocr
Copy link
Contributor

pedrocr commented Aug 15, 2018

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?

@chrisduerr
Copy link
Contributor

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.

@mitchmindtree
Copy link
Contributor

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.

@bepvte
Copy link

bepvte commented Jan 10, 2019

https://github.com/tomaka/winit/blob/ddf133dd66c9bb1b1d98c3525f091539a5347222/src/dpi.rs#L53-L54 make sure to update these documentation lines!
This fixes many issues on my laptop, cant wait for it to be merged.

@francesca64
Copy link
Member

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?

@Osspial
Copy link
Contributor

Osspial commented Apr 25, 2019

Closing, since the rebased version of this got merged.

@Osspial Osspial closed this Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - x11 H - help wanted Someone please save us
Development

Successfully merging this pull request may close these issues.

7 participants