Handle partially off-screen windows.

If a window is partially off-screen, preserve the off-screen regions.