Optimize window positions for MS Windows and OS X.