macos: improve placement of windows
This does some very basic window management so that we place surfaces in locations where they can actually be interacted with correctly.
/CC @matthiasc this would also be nice to get into 4.6.x as previously windows could get placed in some odd spaces depending on the situation.