Thanks, this helped me out a ton with my M4800 running xubuntu. Now I have a docked machine w/ both external monitors and the laptop screen enabled at once.
I can now undock without getting a blank screen. Re-docking doesn’t automatically re-enable the other screens but I can go into the system settings -> display menu and re-enable them easily.
Only problem left for me is that since choosing the proprietary nvidia driver in the ubuntu additional drivers menu and disabling switchable graphics the screen for unlocking my fully encrypted disk doesn’t work. The screen for entering the passphrase pops up but isn’t active or something. There’s a regular black and white cursor one line down from the top and when I type text shows up there unobfuscated and writes over the GUI background. Pressing enter does nothing. To boot I need to go into recovery mode with grub (where there is a text version of the disk unlock passphrase entry) then resume a normal boot.
edit: found a workaround for the disk encryption issue based on the information here https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1375435
edit /etc/default/grub to include the line
remove “splash” from GRUB_CMDLINE_LINUX_DEFAULT
this gives a text prompt for entering the disk encryption passphrase