Seamless Monitor Hotplugging with X Windows
There are times when you want to track the bleeding edge of a particular project, and having a new laptop is often one of those moments... I've recently bought an HP Compaq nx6320 and while most of it is working, one of the reasons I got it was because of Keith Packard's work on the RandR extensions for X.
Well, I was definitely seeing this bug but with a small patch I can get the latest (experimental) packages for xserver-xorg-video-intel to work, and now with a few magic tweaks to my xorg.conf I can make my desktop expand to another monitor when I unsuspend at work, and contract back to just the laptop screen when I resume somewhere else.
The Magic Expanding X Config
First of all, when I got the driver to actually work, xrandr explained to me that my maximum resolution was 1400x1400:
Screen 0: minimum 320 x 200, current 1400 x 1050, maximum 1400 x 1400 VGA disconnected (normal left inverted right) LVDS connected 1400x1050+0+0 (normal left inverted right) 305mm x 228mm 1400x1050 60.0*+ 1280x800 60.0 1280x768 60.0 1024x768 60.0 800x600 60.3 640x480 59.9 TV disconnected (normal left inverted right)
Using a few clues from Ross Burton I managed to get that "maximum 1400x1400" to increase. The trick is to add a "Virtual" setting for screen size into your "Screen" Section, like so:
Section "Screen"
Identifier "Default Screen"
Device "Intel 945GM/GMS/940GML"
Monitor "Laptop Panel"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2680 1050
EndSubSection
EndSection
The downside of this is that if you set the width greater than 2048 (as I have here) then DRI won't work, so you won't get 3d stuff. I guess I can manage without ice-cream, just so long as I get my cake!
Once I have the "Virtual" setting, when I resume at the office I can:
xrandr --output VGA --mode 1280x1024 --pos 1400x0
And then when I resume somewhere without the external monitor, I can:
xrandr --output VGA --off
Quibbles
All of these features are kind of under development, but Xorg 7.3 will support this stuff, and then Gnome and suchlike will have to start thinking about how to deal with it. The dynamic screen changing is not something these environments are completely ready for.
One example is that while I know that monitor is always on the RHS of my docking station, X wants it to be the primary monitor and Gnome moves both panels onto that screen. Perhaps that's not a choice that can be made automatically. Someone who had an external keyboard plugged into their docking station might want the opposite behaviour, and there is certainly no way the environment can magically know whether that monitor is left or right of my laptop screen. Eventually I expect that Gnome will recognise this monitor, and will make the panels and location automatically set the RandR environment to match the way I set it last time.
It is also somewhat annoying that I have to actually choose the virtual size. No doubt this configuration will disappear in due course and it is not really surprising to see it for something which is admittedly quite bleeding edge!
I noticed at LCA that Keith had his own screen set for a Virtual size of 2048x2048, and now I know why: that's the maximum size that is supported for DRI, so if I expand my desktop onto a 1280x1024 screen I'm going to have some overlap. In fact I could almost configure my external monitor to be above my normal screen and use it that way, but it would feel pretty weird I think. In the meantime I've gone back to "blank screen" for my screen saver which admittedly is currently the only application for 3d acceleration on my desktop.
Remaining Problems with this Laptop
The only outstanding issues for me with this laptop are:
- Suspend/Resume to RAM does not work (I use suspend to disk)
- Fingerprint Sensor does not work (AuthenTec say Linux support will be available later this year)
That's about the best Linux compatibility I have had for any of my last five laptops within a month of buying it. Most of them have had much more significant stuff less supported even after three years of use!
Suspend to RAM issues.
Could you give me an e-mail and let me know the symptoms of your suspend to RAM issues? Specifically, is it a keyboard / mouse input issue or something else?
s/X Windows/X Window System/
"It is a window system named X, not a system named X Windows." :)