fix bug causing partially-offscreen windows