Fix Dual Monitor Issues on Ubuntu 17.04

displaymultiple-monitors

I have recently upgraded from Ubuntu 16.10 to Ubuntu 17.04 via the update-manager. Previously, everything was fine with my installation. Now, however, I cannot use dual monitors.

When I open any program, it will open on the right monitor (which is not my default monitor). I move my house over to the right monitor to move the window to the left monitor, and any clicking will take the program out of focus. I found that clicking around on the left monitor in the same position that the program is open on the right monitor will allow me to interact with the program.

I view programs on one monitor, but interact with them on the other. I don't want to do this. What can I do?

Best Answer

If the numbers in CompizConfig Setting Manager don't represent your monitor dimensions, offsets, and rotations, and the numbers don't match the numbers in your ~/.config/monitors.xml file, Compiz might draw and stretch windows into other screens, yet respond to mouse clicks in the first.

You might have too physically configure Compiz and the monitors.xml file yourself, so they each have the same sizes and offsets. Most of the time, Compiz will not autodetect this correctly.

First step is to bring your setup down to one monitor. Then install and open CompizConfig Settings Manager. Go to General Options->Display Settings. There you un-check Detect Outputs. Then you type in all your monitor resolutions, and offsets, one monitor at a time, starting with the upper-left monitor.

I am going to give you my extreme 4-monitor example, so hopefully you get a better example of what needs to happen, and can figure out how to apply it to a two, or three monitor situation.

My 4 monitors looks like this:

    1080         1920         1080
   ________ _______________ _________ 
  |        | 1             |         |
1 |        | 0             |         | 1
9 |        | 8   2nd       |         | 9
2 |  1st   | 0             |   4th   | 2
0 |        |_______________|         | 0
  |        | 1             |         |
  |        | 0             |         |
  |________| 8   3rd       |_________|
           | 0             |
           |_______________|

Which means I set them up like this in CompizConfig Settings Manager -> General Options -> Displays Settings.

1080x1920+0+0
1920x1080+1080+0
1920x1080+1080+1080
1080x1920+3000+0

Where:

1080x1920+0+0 = (1080 wide, 1920 tall, w/offset from upper-left of x=0 to the right, y=0 down)

1920x1080+1080+0 = (1920 wide, 1080 tall, w/offset from upper-left of x=1080 to the right, y=0 down)

1920x1080+1080+1080 = (1920 wide, 1080 tall, w/offset from upper-left of x=1080 to the right, y=1080 down)

1080x1920+3000+0 = (1080 wide, 1920 tall, w/offset from upper-left of x=3000 to the right, y=0 down)

Then you need to go into System Settings->Display and drag the monitor screens around and rotate them to match what you set up in CCSM. The Display GUI is very buggy. You have to make sure the screen you are dragging around is touching another or it won't move. So don't leave a screen hanging off by itself. Once you have them rotated and arrange to match the CCSM settings, click Apply. This will write the ~/.config/monitors.xml file with your configuration. This should put you in a working state, which won't be overwritten next time you log in. Back up the monitors.xml file!

If you unplug or turn off a monitor, things will probably go haywire, so make sure you have a backup of the working monitors.xml file, and know how to go to a tty terminal to restore the file. (Hit CTRL-ALT plus any one of the F1 through F6 keys)