-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugdisplaypygame.displaypygame.displayreproducibleconfirmed that the issue can be replicated and there are instructions to reproduce the issueconfirmed that the issue can be replicated and there are instructions to reproduce the issue
Description
Environment:
- Operating system Windows 10
- Python version Python 3.9.5
- SDL version SDL 2.0.16
- PyGame version Pygame 2.0.2.dev2
Current behavior:
The NOFRAME and RESIZABLE flags do not work when switching from fullscreen mode back to windowed mode, and a non-resizable 'framed' window is set, but the SCALED flag works fine for all cases. This issue can be overriden when the window is set at least 2 times after reverting from fullscreen mode.
Expected behavior:
When window is switched to windowed mode from fullscreen to windowed mode with the NOFRAME or RESIZABLE flags (or both of them), then the window should have no title bar, and be resizable respectively.
Screenshots
Switching to windowed mode after fullscreen mode with NOFRAME flag:

Steps to reproduce:
- open command prompt or powershell
- pip install pygame==2.0.2.dev2
- press any key twice after running the example code
Test code
import pygame
pygame.init()
fullscreen = False
size = (1280, 720)
full_flags = pygame.FULLSCREEN | pygame.SCALED
normal_flags = pygame.NOFRAME | pygame.RESIZABLE | pygame.SCALED
def toggle_fullscreen(f):
if f:
return pygame.display.set_mode(size, full_flags)
# pygame.display.set_mode(size, normal_flags) # uncomment this to see issue being fixed as a workaround
return pygame.display.set_mode(size, normal_flags)
screen = pygame.display.set_mode(size, normal_flags)
clock = pygame.time.Clock()
while True:
screen.fill("purple")
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
raise SystemExit
if event.type == pygame.KEYDOWN:
fullscreen = not fullscreen
screen = toggle_fullscreen(fullscreen)
pygame.display.flip()
clock.tick(144) # framerate
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugdisplaypygame.displaypygame.displayreproducibleconfirmed that the issue can be replicated and there are instructions to reproduce the issueconfirmed that the issue can be replicated and there are instructions to reproduce the issue

