xrandr with XPS 13" (3840x2160) HiDPI and 30" (2560x1600) LowDPI

Tyler tylera at privatedemail.net
Fri Aug 3 01:23:07 UTC 2018


I was able to solve this.

Single laptop monitor:

xrandr --output eDP1 --scale 1x1 --auto \
       --output DP1 --off

Single external monitor:

xrandr --output eDP1 --off \
       --output DP1 --scale 2x2 --auto

Both:

xrandr --output eDP1 --scale 1x1 --auto --pos 5120x0 --primary \
       --output DP1 --scale 2x2 --auto --pos 0x0

Fixing the DPI with Qt was fixed by doing:

export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCREEN_SCALE_FACTORS="2;2"

Turns out there is a bug related to that

https://bugreports.qt.io/browse/QTBUG-67928

> QXcbScreen::logicalDpi() uses:
> 
>     QT_FONT_DPI if set
>     Xft.dpi if set
>     screen.size() / screen.physicalSize()
> 
> This will not produce correct results on X as X fakes the physicalSize by default.
> 
> This causes fonts to get rendered at 96dpi, even if the primary monitor has 192dpi, for instance.
> 
> As a result, it is never enough to just enable HiDPI scaling to get usable results on X11, you always have to specify the DPI manually.

GTK2/GTK3 was working perfectly with just:

export GDK_SCALE=2
export GDK_DPI_SCALE=0.5

The panning command is not required as of Xorg 1.20 as this bug has been
fixed https://bugs.freedesktop.org/show_bug.cgi?id=39949

-- 
Tyler


More information about the xorg mailing list