Sucess with dual monitors

Sarangan Thuraisingham sarangan.thuraisingham at gmail.com
Wed Jun 21 00:55:41 UTC 2006


Jean Hollis Weber wrote:
[snip]
>  and programs
> that had been last displayed on the secondary screen (and closed before 
> I rebooted) could not be seen when I reopened them. Fortunately I 
> quickly discovered how to move them back onto the visible area. 
> (Right-click on program name in bottom panel, choose Move from the 
> pop-up menu, and move the mouse until the program moved into the visible 
> area.) Not ideal, but it works.

This is because Ubuntu thinks that you still have two monitors. There is 
nothing wrong with that

> 
> I guess if I were going to be using the laptop away from my desk for 
> awhile (I often go on trips lasting several weeks), I would have two 
> xorg.conf files -- one for with dual-screen and one for without -- and 
> swap between them. Also not ideal...
> 
> Another thing I haven't tried yet is using the second screen as a clone,
 >... No doubt this means yet more swapping of xorg.conf files.

I think by default laptops with VGA output use clone mode.
> 
> --Jean
> 

Instead of using several xorg.conf files try using ServerLayouts. I have 
attached my xorg.conf file, orginally from http://mg.pov.lt/xorg.conf. 
As you can see in the "ServerFlags" at the end of conf file, I have two 
DefaultLayout lines. One of them is commented depending on whether I 
want to use the dual-screen setup or not.

There are several dual-screen layouts in the xorg.conf file, but only 
the MergedFBLayout worked for me. BTW my graphics card is ATI Radeon 
Mobility M7 LW [Radeon Mobility 7500]. Also when using MergedFBLayout 
you can switch to clone mode by using 'xrandr'.

=========== xorg.conf=================
# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following commands:
#
#   cp /etc/X11/xorg.conf /etc/X11/xorg.conf.custom
#   sudo sh -c 'md5sum /etc/X11/xorg.conf 
 >/var/lib/xfree86/xorg.conf.md5sum'
#   sudo dpkg-reconfigure xserver-xorg

# FROM : http://mg.pov.lt/xorg.conf
#
# mg: I have edited this file manually:
#
#       * I enabled DynamicClocks to provide some power savings
#
#       * I added a couple of ServerLayout sections to play with
#         dual-head support
#
#           startx -- -layout MergedFBLayout
#               Starts in MergedFB mode.  Single large virtual desktop
#               (2048x768), the LCD sees the left half,
#               the external monitor
#               sees the right half.  Ctrl+Alt+[+/-] switches to clone mode
#               where you have a large virtual desktop with just one 
viewport
#               and can scroll horizontally.  xrandr switches to clone mode
#               where the desktop is just 1024x768 with no scrolling.
#
#               MergedFB supports 3D accel and video overlays on both heads.
#               MergedFB supports some Xinerama-style hints that let GNOME
#               maximize windows on only one head.  Sadly, workspaces 
are linked
#               -- you can't switch workspaces on the left head 
independently
#               from the right head.
#
#               MergedFB does not let me have a non-rectangular virtual 
desktop,
#               so if I configure a 1024x768 + 1280x1024 setup, the 
smaller one
#               will scroll inside a bigger a virtual desktop (only 
vertically,
#               also, when scrolling down the mouse cursor casts strange 
green
#               bars all the way to the top).  Try it with
#                   startx -- -layout MergedFB2Layout
#               Actually, there is an option to disable the vertical 
scrolling
#               and set xinerama hints appropriately.  It needs a newer 
version
#               of the radeon driver (from Xorg 6.9):
#                   Option "MergedNonRectangular" "true"
#
#               xrandr works and gives me an opportunity to switch between
#               dualhead and clone!  (If there are windows on the second 
head
#               when I switch to clone, they're moved so that part of them
#               is visible; when I switch back, metacity doesn't repaint 
half
#               of the titlebar ;)
#
#               If the second display is not connected during X startup,
#               MergedFB gets totally disabled, and nothing will bring 
it back
#               (xrandr shows only one mode).  In this mode Firefox breaks
#               totally and never shows any windows on the screen.  The good
#               news is that if I specify CRT2HSync/CRT2VSync, then MergedFB
#               does not get disabled, and Firefox works fine.
#
#               xv: works when mplayer is fully on head 1 or head 2; doesn't
#               work when mplayer overlaps both heads.  Switching to
#               full-screen and back always puts mplayer on the top-left
#               corner of the first head; strange.  Totem doesn't do this.
#
#               DRI: works on both heads, also overlapped.
#
#               http://bugs.xfree86.org/show_bug.cgi?id=276 is very 
informative
#
#           startx -- -layout XineramaLayout
#               Starts in Xinerama mode.  Two heads -- 1024x768 and 
1280x1024.
#               You can move windows between them, like in MergedFB 
mode.  The
#               smaller head doesn't scroll in a bigger virtual space, an
#               improvement over MergedFB.  Workspaces are linked, like in
#               MergedFB.
#
#               If the second display is not connected during X startup,
#               Xinerama gets totally disabled, and nothing will bring 
it back
#               (except server restart).  To avoid this, I have 
hardcoded the
#               CRT2 hsync/vsync ranges in this config file.  This prevents
#               Xinerama/mergedfb from being disabled.
#
#               xv: works on both heads, and also partially when mplayer
#               overlaps them (but video is shown only on one head).
#               mplayer's full-screen doesn't work on second head (it 
displays
#               only 1024x768 image).
#
#               DRI doesn't work at all.
#
#               Xrandr doesn't work at all.  There's no way to tell the 
PC I do
#               not have the second head -- if I unplug the monitor, half of
#               the windows aren't accessible.
#
#           startx -- -layout TwoHeadLayout
#               No Xinerama, just two screens -- :0.0 and :0.1.  You can 
move
#               the mouse between them, but you cannot move windows.  Two
#               completely independent desktops, except for a bunch of GNOME
#               bugs -- e.g. window list applet breaks in the other 
head, etc.
#               You have independent workspaces OTOH, but the inability 
to move
#               windows arbitrarily is a killer :(

Section "Files"
     FontPath    "unix/:7100"                    # local font server
     FontPath    "/usr/share/X11/fonts/misc"
     FontPath    "/usr/share/X11/fonts/cyrillic"
     FontPath    "/usr/share/X11/fonts/100dpi/:unscaled"
     FontPath    "/usr/share/X11/fonts/75dpi/:unscaled"
     FontPath    "/usr/share/X11/fonts/Type1"
     FontPath    "/usr/share/X11/fonts/CID"
     FontPath    "/usr/share/X11/fonts/100dpi"
     FontPath    "/usr/share/X11/fonts/75dpi"
         # paths to defoma fonts
     FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
     FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
EndSection

Section "Module"
     Load    "fglrx"
#   Load    "GLcore"
     Load    "bitmap"
     Load    "ddc"
     Load    "dri"
     Load    "extmod"
     Load    "freetype"
     Load    "glx"
     Load    "int10"
     Load    "type1"
     Load    "vbe"
EndSection

Section "InputDevice"
     Identifier  "Generic Keyboard"
     Driver      "kbd"
     Option      "CoreKeyboard"
     Option      "XkbRules"  "xorg"
     Option      "XkbModel"  "pc105"
     Option      "XkbLayout" "gb"
EndSection

Section "InputDevice"
     Identifier  "Configured Mouse"
     Driver      "mouse"
     Option      "CorePointer"
     Option      "Device"        "/dev/input/mice"
     Option      "Protocol"      "ImPS/2"
     Option      "Emulate3Buttons"   "true"
     Option      "ZAxisMapping"      "4 5"
EndSection
Section "InputDevice"
         Identifier      "Synaptics Touchpad"
         Driver          "synaptics"
         Option          "SendCoreEvents"        "true"
         Option          "Device"                "/dev/psaux"
         Option          "Protocol"              "auto-dev"
##      Option      "HorizScrollDelta"  "0"
# The default RightEdge is 5400; it is too narrow for me
         Option      "RightEdge"     "5000"

     # This is a potential security problem; I only enable it temporarily,
     # to experiment and find out a comfortable RightEdge value
     Option      "SHMConfig"     "true"
EndSection

Section "Device"
     Identifier  "ATI Technologies, Inc. Radeon Mobility 9000 (M7 LW)"
#    Driver      "ati"
     Driver      "radeon"
#    Driver      "fglrx"
     BusID       "PCI:1:0:0"
     Option      "DynamicClocks" "on"
#    Option "UseInternalAGPGART" "no"
##  Option      "backingstore"  "on"
# The next line would enables Fn-F7/Fn-F8 to switch display outputs/screen
# resizing, if I had a newer version of the 'radeon' driver.
##  Option      "BIOSHotkeys"   "on"
EndSection

Section "Device"
     Identifier  "MergedFB ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
#    Driver      "ati"
     Driver      "radeon"
     BusID       "PCI:1:0:0"
     Option      "DynamicClocks" "on"
     Option      "MergedFB"  "true"
     Option      "CRT2Position"  "LeftOf"
     # This allows X to use MergedFB if the external monitor is not 
connected
     # when I start X.  The ranges are taken from DDC values of the CTX 
monitor
     # I use at the office; as listed in Xorg.log.
     Option      "CRT2HSync" "30-80"
     Option      "CRT2VRefresh"  "59-75"
     # The next line lets me switch between dual-head and several clone 
modes
     # of varying resolutions with xrandr.
     Option      "MetaModes" "1024x768-1024x768 1024x768 800x600 640x480"
EndSection

Section "Device"
     Identifier  "MergedFB2 ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
#    Driver      "ati"
     Driver      "radeon"
     BusID       "PCI:1:0:0"
     Option      "DynamicClocks" "on"
     Option      "MergedFB"  "true"
     Option      "CRT2Position"  "LeftOf"
     # The next line lets me switch between dual-head and clone mode 
with xrandr
     Option      "MetaModes" "1024x768-1280x1024 1280x1024 1024x768"
     # A newer version of the radeon driver has an option that disables 
vertical
     # scrolling for the 1024x768 part.
##                  Option "MergedNonRectangular" "true"
EndSection

Section "Device"
     Identifier  "Screen0 ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
#   Driver      "ati"
     Driver      "radeon"
     BusID       "PCI:1:0:0"
     Option      "DynamicClocks" "on"
     Screen      0
EndSection

Section "Device"
     Identifier  "Screen1 ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
#   Driver      "ati"
     Driver      "radeon"
     BusID       "PCI:1:0:0"
     Option      "DynamicClocks" "on"
     Screen      1
EndSection

Section "Monitor"
     Identifier  "Laptop Screen"
     Option      "DPMS"
EndSection

Section "Monitor"
     Identifier  "VGA Out"
     Option      "DPMS"
EndSection

Section "Screen"
     Identifier  "Default Screen"
     Device      "ATI Technologies, Inc. Radeon Mobility 9000 (M7 LW)"
     Monitor     "Laptop Screen"
     DefaultDepth    24
     SubSection "Display"
         Depth       1
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       4
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       8
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       15
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       16
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       24
         Modes       "1024x768" "800x600" "640x480"
     EndSubSection
EndSection

Section "Screen"
     Identifier  "MergedFB Screen"
     Device      "MergedFB ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
     Monitor     "Laptop Screen"
     DefaultDepth    24
     SubSection "Display"
         Depth       1
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       4
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       8
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       15
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       16
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       24
         Modes       "1024x768"
     EndSubSection
EndSection

Section "Screen"
     Identifier  "MergedFB2 Screen"
     Device      "MergedFB2 ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
     Monitor     "Laptop Screen"
     DefaultDepth    24
     SubSection "Display"
         Depth       24
         Modes       "1024x768" "1280x1024"
     EndSubSection
EndSection

Section "Screen"
     Identifier  "Screen0"
     Device      "Screen0 ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
     Monitor     "Laptop Screen"
     DefaultDepth    24
     SubSection "Display"
         Depth       1
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       4
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       8
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       15
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       16
         Modes       "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       24
         Modes       "1024x768"
     EndSubSection
EndSection

Section "Screen"
     Identifier  "Screen1"
     Device      "Screen1 ATI Technologies, Inc. Radeon Mobility 9000 
(M7 LW)"
     Monitor     "VGA Out"
     DefaultDepth    24
     SubSection "Display"
         Depth       1
         Modes       "1280x1024" "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       4
         Modes       "1280x1024" "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       8
         Modes       "1280x1024" "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       15
         Modes       "1280x1024" "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       16
         Modes       "1280x1024" "1024x768"
     EndSubSection
     SubSection "Display"
         Depth       24
         Modes       "1280x1024" "1024x768"
     EndSubSection
EndSection

Section "ServerLayout"
     Identifier  "DefaultLayout"
     Screen      "Default Screen"
     InputDevice "Generic Keyboard"
     InputDevice "Configured Mouse"
     InputDevice "Synaptics Touchpad"
EndSection

Section "ServerLayout"
     Identifier  "MergedFBLayout"
     Screen      "MergedFB Screen"
     InputDevice "Generic Keyboard"
     InputDevice "Configured Mouse"
     InputDevice "Synaptics Touchpad"
EndSection

Section "ServerLayout"
     Identifier  "MergedFB2Layout"
     Screen      "MergedFB2 Screen"
     InputDevice "Generic Keyboard"
     InputDevice "Configured Mouse"
     InputDevice "Synaptics Touchpad"
EndSection

Section "ServerLayout"
     Identifier  "XineramaLayout"
     Screen      "Screen0"
     Screen      "Screen1" LeftOf "Screen0"
     InputDevice "Generic Keyboard"
     InputDevice "Configured Mouse"
     InputDevice "Synaptics Touchpad"
     Option      "Xinerama" "true"
EndSection

Section "ServerLayout"
     Identifier  "TwoHeadLayout"
     Screen      "Screen0"
     Screen      "Screen1" RightOf "Screen0"
     InputDevice "Generic Keyboard"
     InputDevice "Configured Mouse"
     InputDevice "Synaptics Touchpad"
EndSection

Section "DRI"
     Mode    0666
EndSection

Section "ServerFlags"
# Option      "DefaultServerLayout"   "DefaultLayout"
   Option      "DefaultServerLayout"   "MergedFBLayout"
   Option      "DefaultLayout"
   Option      "MergedFBLayout"
# If enabled, lets you deactivate KB/Mouse grabs with Ctrl+Alt+KP_Divide
    Option      "AllowDeactivateGrabs"  "on"
# If enabled, lets you kill clients that grab the server with 
Ctrl+Alt+KP_Multiply
    Option      "AllowClosedownGrabs"   "on"
EndSection

# Composite: slow as hell
## Section "Extensions"
##  Option      "Composite" "Enable"
##  Option      "RENDER"    "true"
##  Option      "DAMAGE"    "true"
## EndSection
======================================

--
Regards,
  Saru
------
ECS, University of Southampton, UK
http://sarangan.thuraisingham.net
------




More information about the ubuntu-users mailing list