xrandr dual-monitor scaling issue
I want to connect my 2560x1600 13" (16:10) MacBook with Ubuntu 16.04 to an external 21" 1920x1080 (16:9) monitor, and have it be usable in terms of scaling.
I have everything scaled perfectly on my MacBook, which has (ignoring differenes in 16:9 to 16:10 conversion) 33% more pixels than the 1920x1080 screen. So I tried to scale the external monitor up to 2560x1440, by 33%.
xrandr --output HDMI2 --scale 1.3333x1.3333 --panning 2560x1440
This creates a desktop of 2560x1440 on the external, but I can only view 1920x1080 at a time. It is a zoom effect, and by moving the cursor to the edge of the screen makes the area I can view move.
I also tried without panning, but that resultet in a section of the monitor not being used (black) and it was restricting my mouse to move there.
I am running Ubuntu 16.04, Unity and Compiz. And my GPU is Mesa DRI Intel(R) Haswell , so there is no discrete AMD or NVIDIA card.
Solution 1:
I had a similar problem and solved it this way.
I have an external big screen 24" 3840x2160 and a laptop same definition 3840x2160 but small screen 15.4"
I wanted the laptop screen to be zoomed because default scaling is too small .. Scaling down result in blurry screen, the solution is to scale everything up with xrandr then use gnome scaling factor :
Here is how to do it (external screen on top of laptop screen but you can arrange in a different way if you change pos parameters)
xrandr --output DP-0 --primary --mode 3840x2160 --pos 0x0 --scale 2x2 --rotate normal --output DP-2 --mode 3840x2160 --pos 0x4320 --scale 1x1 --rotate normal --output DP-1 --off
Explanations :
--output : DP-1 is the external screen, DP-2 is the laptop screen (use xrandr -q to get your devices names)
--mode : both screen have same definitions 3840x2160
--scale 2x2 for external, 1x1 for laptop, this is "relative" to the primary which is external screen here..
--pos : external screen is at position 0x0, laptop screen is bellow at pos 0x(2160*2)=0x4320 because external screen is scalled by 2
Then
gsettings set org.gnome.desktop.interface scaling-factor 2
OR
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gdk/WindowScalingFactor': <2>}"
Solution 2:
The solution that worked for me is to use dconf
to set scale factors, as explained by Malte Skoruppa.
That is, run dconf read /com/ubuntu/user-interface/scale-factor
to get the names and current scale-factor values for your displays. The result might be something like {'eDP-1': 8, 'HDMI2': 8}
.
To zoom in slightly on your HDMI2 screen, you would run:
dconf write /com/ubuntu/user-interface/scale-factor "{'eDP-1': 8, 'HDMI2': 9}"
Note that the scale factor in the GUI is 1/8 the value in dconf, so 8 means 1x scaling, 9 means 1.125x, etc.