Discussion:
xrandr with XPS 13" (3840x2160) HiDPI and 30" (2560x1600) LowDPI
(too old to reply)
Tyler
2018-07-31 03:17:44 UTC
Permalink
Hi,

I am using ArchLinux with i3 on my Dell XPS 13" 9370 @ 3840x2160) HiDPI
and everything works great with:

.Xresources:

! xft fonts
!----------------------------------------------------------------------
Xft.dpi: 220
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

! urxvt
!---------------------------------------------------------------------
URxvt*font: xft:DejaVu Sans Mono for Powerline:size=12: \
minspace=False:antialias=true, \
xft:Segoe UI Emoji:size=12:minspace=False:antialias=true

URxvt*boldFont: xft:DejaVu Sans Mono for Powerline:size=12: \
minspace=False:antialias=true, \
xft:Segoe UI Emoji:size=12:minspace=False:antialias=true

URxvt.letterSpace: -1



and in /etc/profile.d/hidpi.sh

export GDK_SCALE=2
export GDK_DPI_SCALE=0.5
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCREEN_SCALE_FACTORS=2
export QT_QPA_PLATFORMTHEME=qt5ct



However recently I bought a Dell DA300 Mobile Adapter and decided I
wanted to use my external Dell 30" 3000WFP (2560x1600) over DisplayPort.

I found this blog article
https://blog.summercat.com/configuring-mixed-dpi-monitors-with-xrandr.html
which explains exactly what I am trying to do. The only difference is
the placement of the external screen (mine is on the left of the laptop)
and the screen size and resolution.

In that article he uses his HiDPI on both screens and then scales down
on the external screen, which is why he doubles the resolution of the
external display. The reason he does that is so he doesn't have to touch
.Xresources or fiddle with toolkit scaling options.

Using this command I was able to get it working great with a single
external monitor ie the Dell 30" 3000WFP @ (2560x1600)

xrandr --dpi 220 --fb 5120x3200 \
--output eDP1 --off \
--output DP1 --scale 2x2 --panning 5120x3200

With the dual-monitor setup I'm struggling to understand the panning
option. I have looked at https://wiki.archlinux.org/index.php/xrandr and
the man file and still couldn't figure that track x track y part out.
It's not very easy to understand.

So far for the external monitor I have this:

xrandr --dpi 220 --fb 8960x5360 \
--output eDP1 --mode 3840x2160 \
--output DP1 --scale 2x2 --pos -2560x0 --panning 5120x3200+2560+0

What I want is to be able to access the whole area of both screens. In
his example he has a laptop at 3200x1800 and an external monitor at
1920x1080
Dual monitors
xrandr --dpi 276 --fb 7040x3960 \
--output eDP-1 --mode 3200x1800 \
--output DP-1-2 --scale 2x2 --pos 3200x0 --panning 3840x2160+3200+0
--dpi 276 sets the DPI to 276.
--fb 7040x3960 creates one screen with resolution 7040x3960. This is the combined resolution of the two monitors. The high DPI monitor has 3200x1800 resolution. The lower DPI monitor has 1920x1080 resolution, but I double it as I scale it by 2 (see below). Combine these like so: 3200+1920*2 x 1800+1080*2 = 7040x3960. Both monitors share this screen.
--mode 3200x1800 says to use resolution 3200x1800. This is the default, but specifying it is necessary if the monitor is disabled (as it is when using the external monitor by itself) as it enables the monitor.
--scale 2x2 is similar to zooming out. This is necessary as we set the DPI globally to that of the high DPI monitor.
--pos positions it to the right of the laptop monitor.
--panning allows our pointer to access the whole area.
Any help or tips would be much appreciated!
--
Tyler
Ralph Corderoy
2018-07-31 09:00:10 UTC
Permalink
Hi Tyler,
Post by Tyler
With the dual-monitor setup I'm struggling to understand the panning
option. I have looked at https://wiki.archlinux.org/index.php/xrandr
and the man file and still couldn't figure that track x track y part
out. It's not very easy to understand.
Have a look at the RRSetPanning protocol request in
https://www.x.org/releases/X11R7.5/doc/randrproto/randrproto.txt and see
if that helps.
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
ProgAndy
2018-07-31 09:36:34 UTC
Permalink
Post by Tyler
With the dual-monitor setup I'm struggling to understand the panning
option. I have looked at https://wiki.archlinux.org/index.php/xrandr
and the man file and still couldn't figure that track x track y part
out. It's not very easy to understand.
The panning option might be there as a workaround for a bug in xorg.
Since xorg 1.20 the patch to resolve that should be included, so you can
try your configuration without panning.
https://wiki.archlinux.org/index.php/HiDPI#Side_display
Tyler
2018-08-01 02:20:47 UTC
Permalink
Post by ProgAndy
The panning option might be there as a workaround for a bug in xorg.
Since xorg 1.20 the patch to resolve that should be included, so you can
try your configuration without panning.
https://wiki.archlinux.org/index.php/HiDPI#Side_display
The closest I have been able to get was with

xrandr --output eDP1 --auto --output DP1 --auto --scale 2x2 --right-of eDP1

Now everything appears correctly except my laptop screen is on the wrong
side.

Loading Image...

When I tried the reverse


xrandr --output eDP1 --auto --output DP1 --auto --scale 2x2 --left-of eDP1

I didn't just get a flipped result, I got my browser showing over the
middle Loading Image...

also the black space in the first screenshot is supposed to be there,
that's where there is no screen space as my laptop has a higher
resolution than my external monitor.

It should look like screenshot 1 except that workspace 1 should be on
the opposite side.

I also noticed a problem where applications opened on my laptop screen
don't have correct scaling on my external monitor which is another thing
he spoke of in that blog article.
Post by ProgAndy
Second, switching back and forth between dual monitors to one monitor
lead to interesting behaviour. For example, I kept losing the scale
setting on the lower DPI monitor.
exactly that, although it didn't seem to effect GTK3 applications, only
Qt5 ones.

Thankfully things in Wayland seem a lot simpler! In Sway it's as simple
as https://github.com/swaywm/sway/wiki#display-configuration

Have to wait for firefox and thunderbird to have Wayland patches before
I switch as the fonts were all blurry.

For some reason https://aur.archlinux.org/packages/firefox-wayland/ is
really out of date.

This has been a major pain for me.
--
Tyler
ProgAndy
2018-08-01 08:27:03 UTC
Permalink
Post by Tyler
When I tried the reverse
xrandr --output eDP1 --auto --output DP1 --auto --scale 2x2 --left-of eDP1
I didn't just get a flipped result, I got my browser showing over the
middle https://i.imgur.com/QW0IHYw.jpg
I guess --right-of/--left-of don't take the scale into account.
Try to position your monitors absolutely with --pos, probably 0x0 for
DP1 and 5120x0 for eDP1.
Tyler
2018-08-01 10:00:40 UTC
Permalink
Post by ProgAndy
I guess --right-of/--left-of don't take the scale into account.
Try to position your monitors absolutely with --pos, probably 0x0 for
DP1 and 5120x0 for eDP1.
xrandr --dpi 220 --output eDP1 --pos 5120x0 --auto \
--output DP1 --pos 0x0 --auto --scale 2x2

Loading Image... success!

now I guess the only thing to do is to find a solution for Qt5. Windows
on my LowDPI screen don't change scale according to what screen they are
on eg everything is really small, on the laptop screen the scaling is
what it should be.

GTK3 works fine though.

i think that is why he didn't use auto

https://blog.summercat.com/configuring-mixed-dpi-monitors-with-xrandr.html
Post by ProgAndy
Second, switching back and forth between dual monitors to one monitor lead to interesting behaviour. For example, I kept losing the scale setting on the lower DPI monitor.
that's not exactly what is happening to me - because GTK2/3 works fine.

Maybe there are some more Qt vars I can play with besides

export QT_AUTO_SCREEN_SCALE_FACTOR=0
#export QT_SCALE_FACTOR=2
export QT_SCREEN_SCALE_FACTORS=2
export QT_QPA_PLATFORMTHEME=qt5ct
--
Tyler
Bruno Pagani via arch-general
2018-08-01 11:48:14 UTC
Permalink
Post by Tyler
Post by ProgAndy
Second, switching back and forth between dual monitors to one monitor lead to interesting behaviour. For example, I kept losing the scale setting on the lower DPI monitor.
that's not exactly what is happening to me - because GTK2/3 works fine.
Maybe there are some more Qt vars I can play with besides
export QT_AUTO_SCREEN_SCALE_FACTOR=0
#export QT_SCALE_FACTOR=2
export QT_SCREEN_SCALE_FACTORS=2
Try setting the QT_SCREEN_SCALE_FACTORS per display like this for instance:
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
Tyler
2018-08-01 11:58:01 UTC
Permalink
Post by Bruno Pagani via arch-general
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
I didn't even know that was possible.

I tried with: QT_SCREEN_SCALE_FACTORS=eDP1=2,DP1=1 to test but I am
noticing it seems to be truncating to when I look at:

env | grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2

Thanks for the tip though!
--
Tyler
Bastian Beischer
2018-08-01 12:06:38 UTC
Permalink
Tyler,
Post by Tyler
Post by Bruno Pagani via arch-general
Try setting the QT_SCREEN_SCALE_FACTORS per display like this for
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
I didn't even know that was possible.
I tried with: QT_SCREEN_SCALE_FACTORS=eDP1=2,DP1=1 to test but I am
env | grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2
Thanks for the tip though!
use semicolon ";" not comma "," to separate.

Cheers
Bastian
Post by Tyler
--
Tyler
Tyler
2018-08-01 12:11:04 UTC
Permalink
Post by Bastian Beischer
Post by Tyler
Post by Bruno Pagani via arch-general
Try setting the QT_SCREEN_SCALE_FACTORS per display like this for
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
I didn't even know that was possible.
I tried with: QT_SCREEN_SCALE_FACTORS=eDP1=2,DP1=1 to test but I am
env | grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2
Thanks for the tip though!
use semicolon ";" not comma "," to separate.
oops i copy pasted the wrong example.

***@host:~ $ export QT_SCREEN_SCALE_FACTORS=eDP1=2;DP1=1
***@host:~ $ env |grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2

seems DP1=1 lost it's setting. I have noticed when using
xf86-intel-video displays are eDP1 and DP1 and when using modesetting
they're eDP-1 and DP-1.
--
Tyler
Bruno Pagani via arch-general
2018-08-01 12:13:14 UTC
Permalink
Post by Tyler
Post by Bastian Beischer
Post by Tyler
Post by Bruno Pagani via arch-general
Try setting the QT_SCREEN_SCALE_FACTORS per display like this for
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
I didn't even know that was possible.
I tried with: QT_SCREEN_SCALE_FACTORS=eDP1=2,DP1=1 to test but I am
env | grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2
Thanks for the tip though!
use semicolon ";" not comma "," to separate.
oops i copy pasted the wrong example.
QT_SCREEN_SCALE_FACTORS=eDP1=2
seems DP1=1 lost it's setting.
Try quoting then. ;)
Post by Tyler
I have noticed when using
xf86-intel-video displays are eDP1 and DP1 and when using modesetting
they're eDP-1 and DP-1.
Ah that might be correct.
Ralph Corderoy
2018-08-01 12:32:54 UTC
Permalink
Hi Tyler,
Post by Tyler
$ export QT_SCREEN_SCALE_FACTORS=eDP1=2;DP1=1
$ env |grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2
seems DP1=1 lost it's setting.
Others have pointed out the flaw, but to investigate next time,
`set -x' is useful.

$ set -x
$ export QT_SCREEN_SCALE_FACTORS=eDP1=2;DP1=1
+ export QT_SCREEN_SCALE_FACTORS=eDP1=2
+ QT_SCREEN_SCALE_FACTORS=eDP1=2
+ DP1=1
$ set +x
$
--
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy
Bruno Pagani via arch-general
2018-08-01 12:09:09 UTC
Permalink
Post by Tyler
Post by Bruno Pagani via arch-general
QT_SCREEN_SCALE_FACTORS=eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
I didn't even know that was possible.
I tried with: QT_SCREEN_SCALE_FACTORS=eDP1=2,DP1=1 to test but I am
env | grep QT_SCREEN_SCALE_FACTOR
QT_SCREEN_SCALE_FACTORS=eDP1=2
Thanks for the tip though!
The separator is a ; not a comma. ;) And it is likely {E,}DP-1, not
{E,}DP1. And you probably have to use quotes around the whole value,
like this:

QT_SCREEN_SCALE_FACTORS="eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;"
Tyler
2018-08-01 12:27:37 UTC
Permalink
The separator is a ; not a comma. ;) And it is likely {E,}DP-1, not
{E,}DP1. And you probably have to use quotes around the whole value,
QT_SCREEN_SCALE_FACTORS="eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;"
Hmm sadly, it doesn't seem to help.

$ env |grep QT
QT_SCREEN_SCALE_FACTORS=eDP1=2;DP1=1;HDMI1=1;DP2=1;HDMI2=1;
QT_QPA_PLATFORMTHEME=qt5ct
QT_AUTO_SCREEN_SCALE_FACTOR=0

I rebooted and set:

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

and applications Qt apps like wireshark and virtualbox are still
rendering with 2x scaling on both screens. (which looks normal on the
hidpi one, and small on the lowdpi one).
--
Tyler
Bruno Pagani via arch-general
2018-08-01 12:33:21 UTC
Permalink
Post by Tyler
The separator is a ; not a comma. ;) And it is likely {E,}DP-1, not
{E,}DP1. And you probably have to use quotes around the whole value,
QT_SCREEN_SCALE_FACTORS="eDP-1=2;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;"
Hmm sadly, it doesn't seem to help.
$ env |grep QT
QT_SCREEN_SCALE_FACTORS=eDP1=2;DP1=1;HDMI1=1;DP2=1;HDMI2=1;
QT_QPA_PLATFORMTHEME=qt5ct
QT_AUTO_SCREEN_SCALE_FACTOR=0
xrandr --output eDP1 --pos 5120x0 --auto \
--output DP1 --pos 0x0 --auto --scale 2x2
and applications Qt apps like wireshark and virtualbox are still
rendering with 2x scaling on both screens. (which looks normal on the
hidpi one, and small on the lowdpi one).
OK, then maybe you’ve just stumbled upon one of the numerous HiDPI Qt bugs…
Tyler
2018-08-01 12:34:33 UTC
Permalink
https://phabricator.kde.org/D12405#251159
graesslin.Apr 21 2018, 7:01 PM
I also cannot imagine this to work due to the fact how X11 works. There is just no mapping from window to screen. No window can know on which screen it is. Not even KWin knows that as the window manager (screen is not a constant property, but evaluated every time it is accessed, it's based on the distance to closest screen). Especially for overlapping windows it's very difficult to try to get to which screen it belongs. It gets even more complicated when things like panning and overlapping screens get into it. So I wouldn't trust this thing in Qt to work due to the pain we have in KWin especially with these problems.
I wonder if it's possible?
--
Tyler
Tyler
2018-08-01 09:10:48 UTC
Permalink
I also tried doing

xrandr --dpi 220 --output eDP1 --auto --output DP1 --auto --scale 2x2
--right-of DP1

but it resulted in:

xrandr: loop in relative position specifications

what I am trying to achieve (produced in gimp):

Loading Image...


As for moving to sway, doesn't look like this problem will be solved soon :(

https://github.com/swaywm/sway/issues/1047
--
Tyler
Eric Blau
2018-08-01 13:00:11 UTC
Permalink
Hi Tyler,

I did a lot of experimenting a while back to find something that works well
for me. I have a MacBook Pro with a HiDPI screen connected to two 1080p
external monitors via ThunderBolt-to-DisplayPort adapters. I place my
MacBook Pro to the right of the two external monitors. I also run i3.
Here's what I found worked for me:

.Xresources contains:
Xft.dpi: 220

.xinitrc contains:
xrdb -merge ~/.Xresources
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export GDK_SCALE=1.5
export GDK_DPI_SCALE=0.75
exec i3

xrandr command for external monitors:
xrandr --output DP1 --scale 1.5x1.5 --auto --pos 0x0 --primary --output DP2
--scale 1.5x1.5 --auto --pos 2880x0 --output eDP1 --mode 1920x1200 --pos
5760x0

xrandr command for switching back to internal laptop screen:
xrandr --output eDP1 --auto --primary --output DP1 --off --output DP2 --off

I tried playing with panning but I found it easier to just set similar
resolutions using whatever mode I want on the monitors and the proper scale
option and then specifying the absolute positions with --pos. When
external monitors are enabled, I reduce the resolution of my laptop screen
because the laptop is on a stand further away from me so I need the text a
bit larger.

Good luck. Let us know how it goes.

Thanks,
Eric
Post by Tyler
Hi,
! xft fonts
!----------------------------------------------------------------------
Xft.dpi: 220
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
! urxvt
!---------------------------------------------------------------------
URxvt*font: xft:DejaVu Sans Mono for Powerline:size=12: \
minspace=False:antialias=true, \
xft:Segoe UI Emoji:size=12:minspace=False:antialias=true
URxvt*boldFont: xft:DejaVu Sans Mono for Powerline:size=12: \
minspace=False:antialias=true, \
xft:Segoe UI Emoji:size=12:minspace=False:antialias=true
URxvt.letterSpace: -1
and in /etc/profile.d/hidpi.sh
export GDK_SCALE=2
export GDK_DPI_SCALE=0.5
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_SCREEN_SCALE_FACTORS=2
export QT_QPA_PLATFORMTHEME=qt5ct
However recently I bought a Dell DA300 Mobile Adapter and decided I
wanted to use my external Dell 30" 3000WFP (2560x1600) over DisplayPort.
I found this blog article
https://blog.summercat.com/configuring-mixed-dpi-monitors-with-xrandr.html
which explains exactly what I am trying to do. The only difference is
the placement of the external screen (mine is on the left of the laptop)
and the screen size and resolution.
In that article he uses his HiDPI on both screens and then scales down
on the external screen, which is why he doubles the resolution of the
external display. The reason he does that is so he doesn't have to touch
.Xresources or fiddle with toolkit scaling options.
Using this command I was able to get it working great with a single
xrandr --dpi 220 --fb 5120x3200 \
--output eDP1 --off \
--output DP1 --scale 2x2 --panning 5120x3200
With the dual-monitor setup I'm struggling to understand the panning
option. I have looked at https://wiki.archlinux.org/index.php/xrandr and
the man file and still couldn't figure that track x track y part out.
It's not very easy to understand.
xrandr --dpi 220 --fb 8960x5360 \
--output eDP1 --mode 3840x2160 \
--output DP1 --scale 2x2 --pos -2560x0 --panning 5120x3200+2560+0
What I want is to be able to access the whole area of both screens. In
his example he has a laptop at 3200x1800 and an external monitor at
1920x1080
Dual monitors
xrandr --dpi 276 --fb 7040x3960 \
--output eDP-1 --mode 3200x1800 \
--output DP-1-2 --scale 2x2 --pos 3200x0 --panning 3840x2160+3200+0
--dpi 276 sets the DPI to 276.
--fb 7040x3960 creates one screen with resolution 7040x3960.
This is the combined resolution of the two monitors. The high DPI monitor
has 3200x1800 resolution. The lower DPI monitor has 1920x1080 resolution,
3200+1920*2 x 1800+1080*2 = 7040x3960. Both monitors share this screen.
--mode 3200x1800 says to use resolution 3200x1800. This is the
default, but specifying it is necessary if the monitor is disabled (as it
is when using the external monitor by itself) as it enables the monitor.
--scale 2x2 is similar to zooming out. This is necessary as we
set the DPI globally to that of the high DPI monitor.
--pos positions it to the right of the laptop monitor.
--panning allows our pointer to access the whole area.
Any help or tips would be much appreciated!
--
Tyler
Tyler
2018-08-01 14:04:50 UTC
Permalink
Post by Bruno Pagani via arch-general
https://phabricator.kde.org/D12405#251159
graesslin.Apr 21 2018, 7:01 PM
I also cannot imagine this to work due to the fact how X11 works. There is just no mapping from window to screen. No window can know on which screen it is. Not even KWin knows that as the window manager (screen is not a constant property, but evaluated every time it is accessed, it's based on the distance to closest screen). Especially for overlapping windows it's very difficult to try to get to which screen it belongs. It gets even more complicated when things like panning and overlapping screens get into it. So I wouldn't trust this thing in Qt to work due to the pain we have in KWin especially with these problems.
OK, then maybe you’ve just stumbled upon one of the numerous HiDPI Qt bugs…
Which brings me back to the original post.

If I could figure out how to do it this way,

https://blog.summercat.com/configuring-mixed-dpi-monitors-with-xrandr.html

because that sounds like it would avoid this problem.
Post by Bruno Pagani via arch-general
The tricky parts
First, the fact that the two monitors have differing DPI means each monitor needs different settings to account for that. xrandr allows setting the DPI via --dpi, but this applies globally to all monitors. I dealt with this by setting the global DPI to that of the highest DPI monitor, and then used --scale to adjust the lower DPI monitor.
Second, switching back and forth between dual monitors to one monitor lead to interesting behaviour. For example, I kept losing the scale setting on the lower DPI monitor.
The panning option might be there as a workaround for a bug in xorg.
Since xorg 1.20 the patch to resolve that should be included, so you can try your configuration without panning.
I feel he might be right based on the results I had with

xrandr --output eDP1 --pos 5120x0 --auto \
--output DP1 --pos 0x0 --auto --scale 2x2
Post by Bruno Pagani via arch-general
I had a semi-working setup with little trouble, but it involved restarting X when I wanted to switch between dual and single monitors. This worked, but obviously was inconvenient. I wanted a solution that would work without restarts.
I do think he might be right. It does seem like it might be also a
workaround for this Qt5 issue.
Post by Bruno Pagani via arch-general
Single monitor (external)
xrandr --dpi 276 --fb 3840x2160 \
--output eDP-1 --off \
--output DP-1-2 --scale 2x2 --panning 3840x2160
Most of these options are similar to the first command's. The main difference is disabling the laptop monitor with --output eDP-1 --off.
Note 3840x2160 comes from 1920*2 x 1080*2.
You might wonder why I set high DPI and scale the lower DPI monitor here. Wouldn't it be simpler to set a lower DPI and use the monitor's native resolution? That's possible, but since I've configured other things (such as my X terminal fonts) to a size suitable for a high DPI screen, I'd have to adjust settings elsewhere. Keeping the DPI the same and continuing to scale allows me to avoid that. Since I'm scaling, I need to configure a large screen and set panning for the same reasons as before.
I was able to get that working using my numbers for the Dell 30" 3008WFP

xrandr --dpi 220 --fb 8960x5360 \
--output eDP1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --pos 0x0 --panning 5120x3200+3840+0

However with the Dual Monitors not so much;
Post by Bruno Pagani via arch-general
Dual monitors
xrandr --dpi 276 --fb 7040x3960 \
--output eDP-1 --mode 3200x1800 \
--output DP-1-2 --scale 2x2 --pos 3200x0 --panning 3840x2160+3200+0
--dpi 276 sets the DPI to 276.
--fb 7040x3960 creates one screen with resolution 7040x3960. This is the combined resolution of the two monitors. The high DPI monitor has 3200x1800 resolution. The lower DPI monitor has 1920x1080 resolution, but I double it as I scale it by 2 (see below). Combine these like so: 3200+1920*2 x 1800+1080*2 = 7040x3960. Both monitors share this screen.
--mode 3200x1800 says to use resolution 3200x1800. This is the default, but specifying it is necessary if the monitor is disabled (as it is when using the external monitor by itself) as it enables the monitor.
--scale 2x2 is similar to zooming out. This is necessary as we set the DPI globally to that of the high DPI monitor.
--pos positions it to the right of the laptop monitor.
--panning allows our pointer to access the whole area.
Using the numbers I calculated:

eDP1 (30" @ 2560x1600)
DP1 (13.3" @ 3840x2160)

3840+2560*2=8960
2160+1600*2=5360

xrandr --dpi 220 --fb 8960x5360 \
--output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --pos 0x0 --panning 5120x3200+3200+0

using that I am seeing Loading Image... which is a bit
strange but getting closer.

I think i am messing up the last part of panning the +3200+0 bit.

Eric..

You have a very similar setup, to me. I shall give that a try soon.
--
Tyler
Tyler
2018-08-01 14:08:57 UTC
Permalink
Post by Tyler
I was able to get that working using my numbers for the Dell 30" 3008WFP
xrandr --dpi 220 --fb 8960x5360 \
--output eDP1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --pos 0x0 --panning 5120x3200+3840+0
I made a mistake there that should have been:

xrandr --dpi 276 --fb 5120x3200 \
--output DP1 --scale 2x2 --mode 2560x1600 --panning 5120x3200 \
--output eDP1 --off
--
Tyler
Tyler
2018-08-02 08:10:22 UTC
Permalink
So,

Using:

Xft.dpi: 220
GDK_SCALE=2
GDK_DPI_SCALE=0.5
QT_AUTO_SCREEN_SCALE_FACTOR=1

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

I noticed that Qt5 apps look now fine on my external screen (Low DPI)
but now super huge on my laptop screen HiDPI.

I think the reason I avoided using QT_AUTO_SCREEN_SCALE_FACTOR and set
that to 0 was because it was being scaled twice (hence the super
hugeness on my laptop) as apparently it looks at the DPI in xrdb, but I
need that for rxvt, i3 etc.

Without doing what you've done and dropping the resolution on my HiDPI
screen. I found this, using:

GDK_SCALE=2
GDK_DPI_SCALE=0.5

QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCREEN_SCALE_FACTORS=2

Single Screen Laptop:

xrandr --output eDP1 --scale 1x1 --mode 3840x2160 \
--output DP1 --off

All good.

Single Screen External:

xrandr --output eDP1 --off \
--output DP1 --scale 2x2 --mode 2560x1600

All good.

Both screens!

xrandr --output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 --primary \
--output DP1 --scale 2x2 --mode 2560x1600 --pos 0x0

Small fonts on external screen with Qt5.

xrandr --output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --mode 2560x1600 --pos 0x0 --primary

Small fonts on laptop using Qt5. So it seems tied to Primary switch as
to which screen it scales for. Fortunately when using dual monitors I
basically never use virtualbox, wireshark or nvim-qt on the laptop screen.

Incidentally if no primary switch is used the eDP1 becomes primary.
--
Tyler
Bruno Pagani via arch-general
2018-08-02 09:42:33 UTC
Permalink
Post by Tyler
So,
Xft.dpi: 220
GDK_SCALE=2
GDK_DPI_SCALE=0.5
QT_AUTO_SCREEN_SCALE_FACTOR=1
xrandr --output DP1 --scale 2x2 --auto --pos 0x0 --primary \
--output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0
I noticed that Qt5 apps look now fine on my external screen (Low DPI)
but now super huge on my laptop screen HiDPI.
I think the reason I avoided using QT_AUTO_SCREEN_SCALE_FACTOR and set
that to 0 was because it was being scaled twice (hence the super
hugeness on my laptop) as apparently it looks at the DPI in xrdb, but I
need that for rxvt, i3 etc.
Without doing what you've done and dropping the resolution on my HiDPI
GDK_SCALE=2
GDK_DPI_SCALE=0.5
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCREEN_SCALE_FACTORS=2
xrandr --output eDP1 --scale 1x1 --mode 3840x2160 \
--output DP1 --off
All good.
xrandr --output eDP1 --off \
--output DP1 --scale 2x2 --mode 2560x1600
All good.
Both screens!
xrandr --output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 --primary \
--output DP1 --scale 2x2 --mode 2560x1600 --pos 0x0
Small fonts on external screen with Qt5.
xrandr --output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --mode 2560x1600 --pos 0x0 --primary
Small fonts on laptop using Qt5. So it seems tied to Primary switch as
to which screen it scales for. Fortunately when using dual monitors I
basically never use virtualbox, wireshark or nvim-qt on the laptop screen.
Ah, small fonts is something different:
https://bugreports.qt.io/browse/QTBUG-67928
ProgAndy
2018-08-02 11:03:41 UTC
Permalink
Post by Tyler
Small fonts on external screen with Qt5.
xrandr --output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --mode 2560x1600 --pos 0x0 --primary
Small fonts on laptop using Qt5. So it seems tied to Primary switch as
to which screen it scales for. Fortunately when using dual monitors I
basically never use virtualbox, wireshark or nvim-qt on the laptop screen.
Incidentally if no primary switch is used the eDP1 becomes primary.
As far as I understand, QT_SCREEN_SCALE_FACTORS needs an entry for each
screen. The primary screen will get the first factor, then second screen
the second factor, so you can try this:

QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCREEN_SCALE_FACTORS="2;2"
Tyler
2018-08-02 12:12:07 UTC
Permalink
Post by ProgAndy
As far as I understand, QT_SCREEN_SCALE_FACTORS needs an entry for each
screen. The primary screen will get the first factor, then second screen
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCREEN_SCALE_FACTORS="2;2"
SUCCESS! SUCCESS! SUCCESS!!

Now the font for Qt apps is correct on both screens using:

xrandr --output eDP1 --scale 1x1 --mode 3840x2160 --pos 5120x0 \
--output DP1 --scale 2x2 --mode 2560x1600 --pos 0x0

Loading Image...

I have made a revision to the wiki to make that clear.

https://wiki.archlinux.org/index.php?title=HiDPI&type=revision&diff=532206&oldid=529558

Thanks all who have helped!
--
Tyler
Loading...