I changed r. Still not a perfect fix.
glswapbuffer consistency and create the window in the center (still, it doesn't work past sdl r5296)
Patch for
issue #165: Portal: don't allow embedding Objects in ground (or porting them to impassable/invalid locations)