linuxhdmixrandrhidpi

xrandr two screens different resolution without invisible area


Update: the problem has fixed itself. It must have happened with an update of xrandr, Xorg, nvidia or intel gpu drivers, or anything else related, but it works fine again! It wasn't my fault after all...

My laptop has a 4K (3840x2160) screen (dual gpu, nvidia-prime) and sometimes I want to connect my Full HD TV on the HDMI port to watch a video. I prefer the TV not to mirror my 4K screen.

So I start arandr and enable the HDMI input. On my previous installation of this laptop (Linux Arch), my 4K screen then became limited to 1920x1080, so 3/4 of the screen was unusable, even if not mirrored, but I would then just use mirror to watch the video which was limited to the 1/4 of the 4K screen, being the complete TV. On my new installation of this laptop (again, Linux Arch), my desktop seems to resize to 5760x2160, which make the TV only show the upper half of the screen, and showing videos incorrectly because the video application thinks my screen is 1920x2160.

So none of the situations were exactly what I wanted. I want it to work like it would work in Windows (or like my Arch installation on my desktop pc where I have a full HD screen on the left and a 1:1 2K screen on the right, it works perfectly fine there): one 4K screen on the left, one Full HD screen on the right, mouse can't pass the lower part of the screen from left to right, so the desktop is 3840x2160 on the left, 1920x1080 on the right, and the right screen has the same upper edge so the mouse stays on top when I go to the right screen.

As I am trying to automate this, I would like this to work with xrandr (I've already written an udev script which works), but even with xrandr, I don't seem to be able to set the parameters correctly.

I've tried so many things, but I seem to misunderstand the options or something, because whatever I try, it's not working as I expect it.

The simplest thing I tried was just: xrandr --output HDMI-1-0 --auto --right-of eDP-1 --mode 1920x1080 --pos 3840x0. I've tried to add --fb 1920x1080. It doesn't seem to work.

Can anyone help me understand it, maybe even help me configure it?

Edit: I don't know if it's important, but I use i3.

Edit: If I change the resolution of the 4K screen to 1920x1080, mirroring works perfectly. That's the only usable way, but it's still not what I want.

Edit: this is so strange, I just did xrandr --output eDP-1 --auto --output HDMI-1-0 --auto --right-of eDP-1 and my tv now shows an empty desktop, but my mouse is limited to the 4K screen and when I'm in the upper left area, the mouse shows up on the TV also... so it feels like the TV shows a part right of the 4K screen, but the mouse is on the left top part.

Edit: another thing I tried doesn't work: xrandr --output eDP-1 --mode 3840x2160 --fb 3840x2160 --output HDMI-1-0 --mode 1920x1080 --fb 1920x1080 --right-of eDP-1 xrandr: specified screen 1920x1080 not large enough for output eDP-1 (3840x2160+0+0) xrandr: specified screen 1920x1080 not large enough for output HDMI-1-0 (1920x1080+3840+0)


Solution

  • The problem has solved itself with updates, be it in xrandr, Xorg, nvidia, intel, ... The same xrandr commands that didn't work then, work perfectly fine now.