General re-write of window handling for Desktop platforms.