A whole bunch of stuff to take care of primary monitor change