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
Linux/HiDPI scaling when gnome set to autodetect #1150
Comments
Applications really should not rely on this setting for detecting the current scale factor. This is a user preference setting for gnome-shell. Other desktops can and will use a different schema altogether to store this preference. The correct place to query the current scale factor is from the X server itself, via some toolkit's api, or using the X11 api directly to read the server xsettings. This will also prevent you from ending up in normal-dpi mode when 'autodetect' is enabled for that gsettings key (0). |
Slightly off-topic but I can't find the info anywhere else: can anyone comment on how to "query the current scale factor from the X server itself, via some toolkit's api, or using the X11 api directly to read the server xsettings", as mentioned by mtwebster, preferably using gtk? |
This probably works in most cases: https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-monitor-scale-factor In python you could do something like:
Note the deprecation warning - in Gtk 3.22 it's highly recommended to go through the GdkMonitor api instead... old monitor reporting from GdkScreen/GdkDisplay is unreliable (and more or less unmaintained - this is what deprecated means to them.) Something else to note, the 0 isn't technically appropriate - you should be sure you're using a valid monitor index, but under X server, all monitors will have the same scale factor, and I'm pretty certain there's always a monitor 0. |
That works, but it turns out I actually wanted not just the scale factor, but also the (independent) text scale factor. Any idea how to get the equivalent of |
When
org.gnome.desktop.interface scaling-factor
is 0, GNOME automatically detects that I have a hidpi screen but atom does not. It's a minor issue since i can easily changescaling-factor
to 2The text was updated successfully, but these errors were encountered: