Force full-screen game to one monitor?

I have two monitors, one 1920x1200 and the other 1920x1080, and in 10.10 they were "separate". As in when I opened the display preferences they were shown as separate screens. Since installing (from scratch) 11.04 I instead have one giant 3840x1200 screen spread over the two monitors. Not a problem per se, except when I want to play full-screen games! When playing games I want them to be on the primary (1920x1200) monitor, but since the game only detects one screen I cant do that, even if I lower the resolution in-game.

I have a nVidia GTS 250 card, using nvidia-current driver (version 270.41.06), even though "Additional Drivers" reports the driver is "activated but not currently in use".

Is there a way to force the game to use only one of the monitors? Or make the game detect both monitors?


Yes there is. You need to wirte a second metamode into your /etc/X11/xorg.config. For me it looks like this:

 # excerpt from /etc/X11/xorg.config
 Section "Screen"
     Identifier     "Screen0"
     Device         "Device0"
     Monitor        "Monitor0"
     DefaultDepth    24
     Option         "TwinView" "1"
     Option         "TwinViewXineramaInfoOrder" "DFP-0"
     Option         "metamodes" "CRT: nvidia-auto-select +1680+0, DFP: nvidia-auto-select +0+0;1024x786,NULL;NULL,1680x1050"
     SubSection     "Display"
         Depth       24
     EndSubSection
 EndSection

I have an old LCD-monitor connected to my laptop. The LCD is called 'CRT' in xorg.config has a resolution of 1024x768. The laptop screen called 'DFP' in the file with resolution 1680x1050.

In my xorg.config you will find three metamodes (line Option "metamodes" "CRT: nvidia-auto-select +1680+0, DFP: nvidia-auto-select +0+0; 1024x786, NULL; NULL, 1680x1050") devided by semicolons:

  • CRT: nvidia-auto-select +1680+0, DFP: nvidia-auto-select +0+0; uses both monitors in auto select mode.
  • When a resolution of 1680x1050 (i.e. of my laptop screen is requested) the metamode NULL,1680x1050; deactivates the old CRT and sets the laptop screen resolution to that value.
  • Vice versa, when 1024x786 is needed 1024x786,NULL; deactivates the laptop screen and sets CRT to that resolution.

Now you just have to add similar entries. Finding out which display is called what will help. Then you have to set your game to use the resolution specified in the additional metamode. That should do the trick.