Allow storing and restoring virtual desktops.

Window handles are stored and when a virtual desktop is restored and the
handles are still present, they are reassigned to the virtual desktop.