xrandr --above does not take --scale into account
Submitted by Emmanuel Beffara
Assigned to Xorg Project Team
Link to original bug (#107721)
Description
(This does not feel like a server side bug, I wanted to file this bug in App/xrandr but somehow the bugzilla does not offer this option)
It seems that relative placement options --above, --below etc do not take into account the scaling specified by --scale.
My precise setup is as follows:
- Dell XPS 9370 laptop (13" with Intel UHD Graphics 620)
- internal HiDPI LCD display "eDP1" with native resolution 3840x2160
- external LCD screen "DP1" with native resolution 1280x1024
In order to get a satisfactory dual-screen setup, I use the 2x2 scaling on the external screen to make it appear logically as 2560x2048 so that things can be moved smoothly between the two screens. If I want the external screen appear to be on the right of the internal one, the following works fine:
xrandr --output DP1 --scale 2x2 --right-of eDP1
However, if I want the external display to appear to be above the internal one, the natural variation does not work:
xrandr --output DP1 --scale 2x2 --above eDP1
This actually sets eDP1 at position 0x1024 so that the two screens overlap and I see the lower half of DP1 at the top of eDP1. I tried to specify DP1 first as
xrandr --output DP1 --scale 2x2 --output eDP1 --primary --below DP1
but the result is the same. I get a working setup if I place the internal display explicitly:
xrandr --output eDP1 --pos 0x2048 --output DP1 --scale 2x2
This does work, but if I plug a screen with a different natural resolution, I cannot use the same script to just "put the external screen above the internal one", instead I have to come up with a new invocation each time.