You are not logged in.

#1 2015-10-23 21:37:12

ackalker
Member
Registered: 2012-11-27
Posts: 201

(Hi)DPI forced in xorg.conf ignored by some apps after gtk3 upgrade

To make things more readable, I've been forcing custom DPI values using settings in xorg.conf for some time without any trouble.

After a recent full system upgrade, some applications no longer scale to my forced DPI, notably lightdm (with lightdm-gtk-greeter) and LibreOffice. Others don't appear to be affected, like i3, lxappearance and qtractor.

LightDM greeter, before the upgrade:
LightDM greeter, before the upgrade

LightDM greeter, after the upgrade:
LightDM greeter, after the upgrade

I'm seeing the same problem on both my host system (using NVIDIA proprietary driver) and in a QEMU VM.

These are the settings which I'm using to force 160x160 DPI:

/etc/X11/xorg.conf.d/10-screen.conf:

Section "Screen"
        Identifier "Screen 0"
        Monitor "23EA63"
EndSection

/etc/X11/xorg.conf.d/90-force-dpi.conf

Section "Monitor"
        Identifier "23EA63"
        # For use with NVIDIA
        Option "UseEdidDpi" "false"
        Option "DPI" "160 x 160"
        # Using a generic method
        #DisplaySize 304.8 171.4
EndSection

Both before and after the upgrade, xdpyinfo showed the correct (forced) DPI values:

$ xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    1920x1080 pixels (305x171 millimeters)
  resolution:    160x160 dots per inch

Using git bisect and the Arch Linux Archive, I was able to pinpoint the updates between 2015-10-01 and 2015-10-02 as being the culprit.

Snippet of /var/log/pacman.log upgrading from 2015-10-01 (last "good") to 2015-10-02 (first "bad"):

[2015-10-23 20:48] [PACMAN] Running 'pacman -Syyuu'
[2015-10-23 20:48] [PACMAN] synchronizing package lists
[2015-10-23 20:48] [PACMAN] starting full system upgrade
[2015-10-23 20:48] [ALPM] transaction started
[2015-10-23 20:49] [ALPM] upgraded glib2 (2.44.1-1 -> 2.46.0-2)
[2015-10-23 20:49] [ALPM] upgraded xz (5.2.1-1 -> 5.2.2-1)
[2015-10-23 20:49] [ALPM] upgraded gdk-pixbuf2 (2.31.7-1 -> 2.32.1-1)
[2015-10-23 20:49] [ALPM] upgraded gtk-update-icon-cache (3.16.7-1 -> 3.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded mesa (11.0.1-1 -> 11.0.2-1)
[2015-10-23 20:49] [ALPM] upgraded mesa-libgl (11.0.1-1 -> 11.0.2-1)
[2015-10-23 20:49] [ALPM] upgraded pango (1.36.8-1 -> 1.38.0-1)
[2015-10-23 20:49] [ALPM] upgraded librsvg (1:2.40.9-2 -> 1:2.40.10-1)
[2015-10-23 20:49] [ALPM] upgraded adwaita-icon-theme (3.16.2.1-1 -> 3.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded at-spi2-core (2.16.0-1 -> 2.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded atk (2.16.0-1 -> 2.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded at-spi2-atk (2.16.0-1 -> 2.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded gsettings-desktop-schemas (3.16.1-1 -> 3.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded glib-networking (2.44.0-3 -> 2.46.0-1)
[2015-10-23 20:49] [ALPM] upgraded libsoup (2.50.0-1 -> 2.52.0-1)
[2015-10-23 20:49] [ALPM] upgraded gtk3 (3.16.7-1 -> 3.18.0-1)
[2015-10-23 20:49] [ALPM] upgraded iso-codes (3.61-1 -> 3.62-1)
[2015-10-23 20:49] [ALPM] warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
[2015-10-23 20:49] [ALPM] upgraded pacman-mirrorlist (20150923-1 -> 20151002-1)
[2015-10-23 20:49] [ALPM] transaction completed

I do have a workaround: create or edit the file: ${HOME}/.Xresources and add:

! Increase DPI for larger fonts
Xft.dpi:		160

Note that this doesn't affect LightDM's greeter, which remains tiny. Also, I do see this as a workaround, not a final solution, as I don't like having to specify basically the same thing in more than one place (xorg.conf files as well as .Xresources).

Last edited by ackalker (2015-10-24 15:49:17)

Offline

#2 2015-10-24 14:59:09

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: (Hi)DPI forced in xorg.conf ignored by some apps after gtk3 upgrade

I took the plunge and downgraded just the gtk3 package in the QEMU VM from version 3.18.0-1 to 3.16.7-1. Result: Things get scaled correctly again for the forced DPI. Jippy, that makes bisecting the root cause of this a bit easier I hope, fewer dependencies to check.

Proceeding to bisect using a versioned PKGBUILD, I found the offending gtk3 version change to be from 3.17.4 to 3.17.5.

Just eyeballing the changes between these versions makes me think that this commit is the culprit. Instead of calculating the DPI from information provided by the X server, GTK+ now forces the use of 96 DPI unless the user has the Xft.dpi X resource set to something else. Pretty damn harsh on HiDPI users, IMO.
In this KDE bug report there is also an interesting discussion mentioning the above commit.

I'm now looking for alternative ways to force DPI in a DM/WM/DE agnostic way. Any suggestions?

Currently I:

1) Specify "DisplaySize" in xorg.conf to make the i3 window manager and Qt apps scale properly.

2) Specify "xft-dpi" in /etc/lightdm/lightdm-gtk-greeter.conf to make the LightDM GTK+ greeter scale properly.

3) Specify "Xft.dpi" in /etc/X11/Xresources to make non-i3 sessions and GTK+ apps scale properly.

Not an ideal situation compared to my previous setup (a single setting in xorg.conf) to say the least.

Last edited by ackalker (2015-10-26 10:45:00)

Offline

#3 2015-10-26 14:42:46

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: (Hi)DPI forced in xorg.conf ignored by some apps after gtk3 upgrade

I've created a bug report on the GNOME bugtracker. Let's see how this goes...

Offline

#4 2015-10-26 23:42:22

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: (Hi)DPI forced in xorg.conf ignored by some apps after gtk3 upgrade

The bug got a "RESOLVED WONTFIX".

Well, I guess that the glorious days of automatic DPI configuration combined with user freedom are over, at least for GTK+... Sigh.

"It's a GNOME's GTK+'s GNOME's world..."

Last edited by ackalker (2015-10-26 23:49:05)

Offline

#5 2016-02-07 23:07:15

stiffitydoodah
Member
From: Ohio, USA
Registered: 2015-01-23
Posts: 5

Re: (Hi)DPI forced in xorg.conf ignored by some apps after gtk3 upgrade

Thank you for talking to yourself here for a while, you helped me get all of my stuff speaking in the same resolution.

Offline

Board footer

Powered by FluxBB