Skip to content

Mac - pygame.Window.flip() seemingly doesn't work since v2.5.0.dev4 was implemented #3056

Closed
@rethanon

Description

@rethanon

I was following up on a help post on the Discord server, and I have replicated an issue where pygame.Window.flip() no longer seems to work on Mac.

Current behavior:

When you create a window and get the associated surface, if you fill the surface, or draw to it, or load an image and blit to it, then call flip(), the screen is not updated and remains blank/black.

Expected behavior:

The window surface is updated and images, shapes, fill colors are presented correctly on the surface.

Steps to reproduce:

On a Mac:

  1. Create a pygame.WIndow object
  2. get the display surface by calling pygame.Window.get_surface()
  3. fill the surface, or draw to it, or blit an image to it
  4. call pygame.Window.flip()
  5. Observe the screen remaining blank/black

Test code

The test code is that which is listed in the docs, however I have tested with drawing shapes and blitting images to the surface and have the same results:

import pygame
 
win = pygame.Window()
surf = win.get_surface()  # get the window surface
 
while True:
   for event in pygame.event.get():
      if event.type == pygame.QUIT:
            pygame.quit()
            raise SystemExit
 
   # draw something on the surface
   surf.fill("red")
 
   win.flip()  # update the surface to the window

Please note I've repeated the testing on Windows and have no issues, works fine.

On Mac my testing showed the following:
2.4.0 to 2.5.0.dev2 - sample code works successfully
2.5.0.dev4 and beyond - sample code runs but the window / surface is not updated

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions