autorandr
autorandr copied to clipboard
Recognize when panning is not used
Problem:
When I save my screen layout with autorandr -s, I did not enable panning.
Later, the screen layout was changed and panning was added.
When I restore the previous layout with autorandr -l, panning was still enabled, causing a messed up layout.
I expect autorandr to know that panning was disabled and save it as part of the config.
Agreed, that's a bug. Will look into it.
Could you give me the xrandr --verbose output both with and without panning, plus the configuration (config files)? I am having trouble reproducing this.
xrandr --verbose > xrandr-before.txt
autorandr -s TMP
xrandr --output DP-4 --panning 3000x1440
xrandr --verbose > xrandr-afterpanning.txt
autorandr -l TMP
xrandr --verbose > xrandr-final.txt
cat ~/.config/autorandr/TMP/config > autorandr-config.txt
autorandr-config.txt xrandr-afterpanning.txt xrandr-before.txt xrandr-final.txt
Using autorandr 1.9 on archlinux.
That's funny. Here's the commands that autorandr wants to run on my machine:
xrandr --fb 4480x1440 --output DP-2 --panning 0x0 --output DP-4 --panning 0x0
xrandr --fb 4480x1440 --output DP-2 --crtc 2 --gamma 1.0:1.0:1.0 --mode 1920x1080 --panning 0x0 --pos 0x0 --rate 60.00 --reflect normal --rotate normal --output DP-4 --crtc 0 --gamma 1.0:1.0:1.0 --mode 2560x1440 --panning 0x0 --pos 1920x0 --rate 59.95 --reflect normal --rotate normal
..it clearly attempts to disable panning!
Could you experiment with what's required to actually disable it?
strace -s 9999 -fe trace=execve autorandr -l TMP
it tells me that the command autorandr wants to run is:
xrandr "--fb" "4480x1440" "--output" "DP-2" "--crtc" "2" "--gamma" "1.25:1.0:0.833" "--mode" "1920x1080" "--panning" "0x0" "--pos" "0x0" "--rate" "60.00" "--reflect" "normal" "--rotate" "normal" "--output" "DP-4" "--crtc" "0" "--gamma" "1.25:1.0:0.833" "--mode" "2560x1440" "--panning" "0x0" "--pos" "1920x0" "--rate" "59.95" "--reflect" "normal" "--rotate" "normal"
When I execute this command manually, it does NOT set panning to 0x0, but produce what's in xrandr-final.txt.
Some other observations I had:
- What's more wrong is that, in xrandr-final.txt, the position of DP-4 is 0x0, but in xrandr-before.txt and also the command autorandr runs, its pos is 1920x0.
- After running
xrandr "--output" "DP-2" "--panning" "0x0" "--output" "DP-4" "--panning" "0x0" "--pos" "1920x0"
it still produces pos=0x0 and panning=4480x1440 for DP-4
- After running
xrandr "--output" "DP-2" "--panning" "0x0" "--output" "DP-4" "--panning" "0x0"
now panning of both is set to 0x0. 4. After (3), I run
xrandr "--output" "DP-2" "--panning" "0x0" "--output" "DP-4" "--panning" "0x0" "--pos" "1920x0"
it agains produces pos=0x0 and panning=4480x1440 for DP-4 5. what works for me eventually is to run "xrandr --panning 0x0" first without "--pos", i.e. (3), and then run "xrandr --pos" without "--panning". This can gives me correct panning and pos in the end.
It seems to specific to usage of xrandr. Any thoughts? Does xrandr not work when "pos" and "panning" are both provided?
I wonder how (4) reenables panning.. is there by any chance another component running that attempts to modify the configuration?
I don't think there are other apps affecting this, but how can I be sure?
Some other interesting findings:
Starting from original state, running
xrandr --output DP-2 --panning 0x0 --output DP-4 --panning 0x0
brings me to xrandr-final.txt Then, running the same command again, it gives me back no panning. (but pos is still modified by the first step)
btw, I'm using a nvidia card and there are random reports online that it does not play well with xrandr's panning settings: https://askubuntu.com/questions/853048/xrandr-adds-weird-virtual-screen-size-and-panning https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1326688
So far it seems this is not an autorandr issue, and perhaps not even a xrandr issue. Feel free to close it if that works the best for you.