I've installed Xubuntu 19.04, and to account for my laptop's screen resolution, in
/etc/lightdm/lightdm.conf I've added the line
xserver-command=X -dpi 166
The result is that XFCE panel, terminal and other GTK2 and GTK3 programs take on the correct font sizes (the same as if I had set Custom DPI setting in Appearance→Fonts to 166), but all the others like e.g. Yakuake still see 96 DPI. Moreover, if I try
xdpyinfo, I do get this 96 DPI:
$ xdpyinfo | grep dot resolution: 96x96 dots per inch
Also, if I tick and untick back the Custom DPI setting option, the fonts shrink back in XFCE too (apparently, DPI gets re-queried from X server).
So I suspect that, during session startup, some entity changes the screen DPI setting as if by running
xrandr --dpi 96. If I manually run
xrandr --dpi 166, programs start behaving correctly.
I'd like to find out what exactly entity is doing this, so as to fix this at the core instead of adding post-startup workarounds. How can I find it?