There is setting which doesn't allow cursor to get out of window boundaries.