Constrain window resize to usable area of platform window.
Optimisation.
Merge branch 'new-window-resize' into slevenbits