Ubuntu overlapping displays while scaling dual monitor setup

#Ubuntu

Table of Contents

Today, again I wanted to change my screen's display size, in my Ubuntu 14.04. This time I have a dual monitor setup and I tried all the commands I mentioned in my blog post Ubuntu scaling the display (Zooming).\\

 1➜  ~  xrandr
 2Screen 0: minimum 8 x 8, current 2560 x 1024, maximum 16384 x 16384
 3VGA-0 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 376mm x 301mm
 4    1280x1024      60.0*+   75.0
 5    1152x864       75.0
 6    1024x768       75.0     60.0
 7    800x600        75.0     60.3
 8    640x480        75.0     59.9
 9LVDS-0 connected (normal left inverted right x axis y axis)
10    1600x900       60.0 +   40.0
11DP-0 connected primary 1280x1024+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
12    1280x1024      60.0*+   75.0
13    1152x864       75.0
14    1024x768       75.0     60.0
15    800x600        75.0     60.3
16    640x480        75.0     59.9
17DP-1 disconnected (normal left inverted right x axis y axis)
18HDMI-0 disconnected (normal left inverted right x axis y axis)
19DP-2 disconnected (normal left inverted right x axis y axis)
20DP-3 disconnected (normal left inverted right x axis y axis)
21➜  ~  xrandr --output DP-0 --scale 1.25x1.25
22➜  ~  xrandr --output VGA-0 --scale 1.25x1.25
23➜  ~  xrandr
24Screen 0: minimum 8 x 8, current 2880 x 1280, maximum 16384 x 16384
25VGA-0 connected 1600x1280+1280+0 (normal left inverted right x axis y axis) 376mm x 301mm
26    1280x1024      60.0*+   75.0
27    1152x864       75.0
28    1024x768       75.0     60.0
29    800x600        75.0     60.3
30    640x480        75.0     59.9
31LVDS-0 connected (normal left inverted right x axis y axis)
32    1600x900       60.0 +   40.0
33DP-0 connected primary 1600x1280+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
34    1280x1024      60.0*+   75.0
35    1152x864       75.0
36    1024x768       75.0     60.0
37    800x600        75.0     60.3
38    640x480        75.0     59.9
39DP-1 disconnected (normal left inverted right x axis y axis)
40HDMI-0 disconnected (normal left inverted right x axis y axis)
41DP-2 disconnected (normal left inverted right x axis y axis)
42DP-3 disconnected (normal left inverted right x axis y axis)

Though it changes the display size, both the screens had overlapping images. After so much analysis, I found one inconsistency in the output of xrandr, before and after scaling. Note the first two lines.\\

1Screen 0: minimum 8 x 8, current 2560 x 1024, maximum 16384 x 16384
2VGA-0 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 376mm x 301mm
3...
4Screen 0: minimum 8 x 8, current 2880 x 1280, maximum 16384 x 16384
5VGA-0 connected 1600x1280+1280+0 (normal left inverted right x axis y axis) 376mm x 301mm

Individual screen's resolution has scaled to 1600x1280 from 1280x1024, but the total screen size is 2880 x 1280, also the screen's position is 1280x0 instead of 1600x0. So, to get over the overlapping problem, I used the following command, after reboot, and it worked\\

 1➜  ~  xrandr --output DP-0 --scale 1.25x1.25 --pos 0x0 --output VGA-0 --scale 1.25x1.25 --pos 1600x0
 2➜  ~  xrandr
 3Screen 0: minimum 8 x 8, current 3200 x 1280, maximum 16384 x 16384
 4VGA-0 connected 1600x1280+1600+0 (normal left inverted right x axis y axis) 376mm x 301mm
 5    1280x1024      60.0*+   75.0
 6    1152x864       75.0
 7    1024x768       75.0     60.0
 8    800x600        75.0     60.3
 9    640x480        75.0     59.9
10LVDS-0 connected (normal left inverted right x axis y axis)
11    1600x900       60.0 +   40.0
12DP-0 connected primary 1600x1280+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
13    1280x1024      60.0*+   75.0
14    1152x864       75.0
15    1024x768       75.0     60.0
16    800x600        75.0     60.3
17    640x480        75.0     59.9
18DP-1 disconnected (normal left inverted right x axis y axis)
19HDMI-0 disconnected (normal left inverted right x axis y axis)
20DP-2 disconnected (normal left inverted right x axis y axis)
21DP-3 disconnected (normal left inverted right x axis y axis)

Now, you see that both the actual size of the screen and the starting position of the second screen is set properly.\\

1Screen 0: minimum 8 x 8, current 3200 x 1280, maximum 16384 x 16384
2VGA-0 connected 1600x1280+1600+0 (normal left inverted right x axis y axis) 376mm x 301mm
3...