-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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: Implemented dpi detection #4905
Conversation
Mhh, how can the travis build find the header, but then doesn't have XRRMonitorInfo? Don't tell me it's not available in that version... |
Hm, travis uses Xrandr 1.3.2, from 2009... i.e. this header: http://code.metager.de/source/xref/xorg/lib/libXrandr/include/X11/extensions/Xrandr.h?r=59c8812099f33d56b43044f999ffe5df16adf5ff It would be nice to get new versions of those libs while keeping the glibc from 12.04 LTS :P |
Looks like there might be a way to install the Xorg stack from 14.04 LTS on 12.04 LTS: https://pkgs.org/ubuntu-12.04/ubuntu-updates-main-amd64/libxrandr-dev-lts-trusty_1.4.2-1~precise1_amd64.deb.html Would need someone with a bit more Ubuntu experience than I have though to find the proper package names to update (I guess we can't update just xrandr and keep the older xorg). |
Alright, nice. I was about to load the symbol(s) at runtime, but updating the package would be a lot cleaner ^^ |
It doesn't work sadly, I gave it a try but it's not on the whitelist of Travis: https://travis-ci.org/godotengine/godot/jobs/133926740 We are using the container-based environment which is Travis' recommended build environment: https://docs.travis-ci.com/user/ci-environment/ On the other hand for the official builds on https://travis-ci.org/GodotBuilder/godot-builds we are using the Trusty (Ubuntu 14.04 LTS) platform, so there the xrandr version should be new enough hopefully. So we could go back to the trusty forever-in-beta platform, but those are more limited and have lower priorities, so it might have a negative impact on our CI overall :( |
Symbol loading it is then^^ |
f74920c
to
e6d3b9c
Compare
Ok, builds now. |
Well, as X11 headers from Keith Packard and co often change in incompatible way |
X11 does provide some geometry information via |
The problem is generally because in all distros the X server DPI is On Wed, Jun 1, 2016 at 5:09 PM, Hondres [email protected] wrote:
|
The arch wiki has some relevant info. You could just try querying all of the different dpi sources mentioned in the wiki: X11 (xdpyinfo?) , gnome (gsettings), and toolkit environment variables (GTK = GDK_SCALE, QT = QT_AUTO_SCREEN_SCALE_FACTOR). I've never tried detecting dpi programmatically on linux so im afraid I won't be much help. |
Chromium's xrandr implementation: https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/widget/desktop_aura/desktop_screen_x11.cc |
I'm guessing GTK just pulls that info from GetDisplayWidthMM() so maybe thats the best way to go. xdpyinfo uses that method https://cgit.freedesktop.org/xorg/app/xdpyinfo/tree/xdpyinfo.c. |
how's the status of this? |
depends on XRandR. Had to dynamically load `XRRGetMonitors` as Ubuntu 12.04 doesn't have it. Also removed libudev from travis install list.
Ok, added the fallback method. |
depends on XRandR