This was especially funny with GNOME, because the desktop actually used the full resolution, and I could move windows over the whole screen. Only the panels were stuck in the middle of the screen.
Apparently I'm not the only one with this problem, so let me tell you what I found out and how to fix this.
Everything was fine with Ubuntu Feisty. When I connected an external monitor, the laptop screen switched off and the higher resolution was used. But now when I connect an external monitor, the laptop screen doesn't switch off automatically.
Because the laptop screen is still on, the system now has two screens and GNOME will automatically adapt to the screen with the lower resolution.
The moment I manually switched off the laptop screen with the tool xrandr
$ xrandr --output LVDS --off
the GNOME panels jumped to their correct position. So let's investigate this xrandr a bit more.
xrandr is a powerful tool for managing multiple video outputs, rotating the screen, and setting up multihead displays.
You can get a list of what the graphics driver thinks it has connected by invoking
$ xrandr -q
This will give you something like this:
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 1680 x 1200
VGA-0 connected 1680x1050+0+0 (normal left inverted right) 433mm x 271mm
1680x1050 60.0*+ 60.0
1280x1024 75.0 59.9
1440x900 75.0 59.9
1024x768 75.1 60.0
800x600 75.0 60.3
640x480 75.0 60.0
LVDS connected (normal left inverted right)
1024x768 60.0 + 60.0
S-video disconnected (normal left inverted right)
The interesting entries are LVDS (the laptop screen) and VGA-0 (the external monitor). Both are connected. VGA-0 might be called VGA or similar on your system, as this name is driver-dependent.
If I wanted to check if an external monitor was connected, I'd just run
$ xrandr -q | grep "^VGA.* connected"
VGA-0 connected 1280x1024+0+0 (normal left inverted right) 338mm x 270mm
I want the system to switch off the laptop screen whenever an external monitor is connected, so that GNOME will use the higher resolution. This easily can be done by adding the following lines to /etc/gdm/Init/Default just before the
xrandr -q | grep "^VGA.* connected" >/dev/null
if [ $RC = 0 ]; then
xrandr --output LVDS --off
It will also make gdm use the full resolution.