pygame icon indicating copy to clipboard operation
pygame copied to clipboard

Behavior change in fullscreen behavior on gaining focus

Open justinbeetle opened this issue 2 years ago • 0 comments

On Windows 11, pygame 2.5.2 changed the behavior when the window of a fullscreen (tested with the flags = pygame.FULLSCREEN | pygame.NOFRAME | pygame.SRCALPHA) pygame app loses and gains focus. It now processes a WindowSizeChanged event that it previously did not and the display surface is cleared (all black) such that the window will go all black with the next pygame.display.flip() if nothing is blit to the surface. I'm wondering if this is related to https://github.com/pygame/pygame/pull/4007.

In pygame 2.5.1, the following are the Window* events on loss of focus:

<Event(32786-WindowFocusLost {'window': None})>

When focus is subsequently gained, these are the Window* events:

<Event(32785-WindowFocusGained {'window': None})>
<Event(32776-WindowExposed {'window': None})>

In pygame 2.5.2, the following are the Window* events on loss of focus:

<Event(32779-WindowSizeChanged {'x': 3440, 'y': 1440, 'window': None})>
<Event(32780-WindowMinimized {'window': None})>
<Event(32786-WindowFocusLost {'window': None})>

When focus is subsequently gained, these are the Window* events:

<Event(32785-WindowFocusGained {'window': None})>
<Event(32779-WindowSizeChanged {'x': 3440, 'y': 1440, 'window': None})>
<Event(32782-WindowRestored {'window': None})>
<Event(32776-WindowExposed {'window': None})>

justinbeetle avatar Dec 18 '23 23:12 justinbeetle