Fix a bug where the cursor could move outside the screen frame.