-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Environment:
- Operating system Windows 10
- Python version 3.9.2
- SDL version 2.0.16
- PyGame version 2.0.2
Current behavior:
Mouse cursor becomes visible and gets stuck (will not move further right) on the right side of the window when in virtual mouse input mode (using pygame.mouse.set_visible(False); pygame.event.set_grab(True). Cursor can still move up and down on right side.
Moving to the left, top and bottom sides of the window works as expected.
Bug does not occur in PyGame 2.0.1.
Screenshots
Before moving cursor to right side. Cursor is not visible and events are working normally.

Cursor becomes visible on right side of window and will not move any further. (Green outline added by Windows Steps Recorder and not relevant)

Steps to reproduce:
Run the test code below with PyGame 2.0.2. Move the mouse cursor to the right side of the window.
Test code
import pygame
pygame.init()
if __name__ == '__main__':
surface = pygame.display.set_mode((100, 100))
pygame.mouse.set_visible(False)
pygame.event.set_grab(True)
while True:
pygame.event.get()
Replace pygame.event.get() with the following to observe that no rightwards mouse motion is observed by event.rel when the cursor is stuck on the right side:
for event in pygame.event.get():
if event.type == pygame.MOUSEMOTION:
print(event.rel[0])