Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The main program blocks when the window is dragged or resized. #3027

Open
balabala314 opened this issue Aug 2, 2024 · 3 comments
Open

The main program blocks when the window is dragged or resized. #3027

balabala314 opened this issue Aug 2, 2024 · 3 comments
Labels
bug Not working as intended SDL sdl3 Windows

Comments

@balabala314
Copy link

As you can see from the title, this issue seems to be Windows only!It's very annoying and I couldn't find a solution anywhere else

@balabala314 balabala314 added the bug Not working as intended label Aug 2, 2024
@oddbookworm
Copy link
Member

Unfortunately, there’s nothing we can do about it for now. This is an SDL limitation. If I remember correctly, SDL3 will have an opt-in way of fixing it, but it’s not released yet, and it’ll probably take us some time to adopt it after the release (thanks @Starbuck5 for championing the SDL3-compat efforts so far). I’ll leave this issue open for now because it’s a legitimate issue, just not one we can fix right now. I’ll look later when I’m back at my desk to see if this is a duplicate of another open issue

@aatle
Copy link
Contributor

aatle commented Aug 2, 2024

There's a closed issue with more information:
https://www.github.com/pygame/pygame/issues/1525
(#854 on this repo)

I've noticed that since the blocking is basically equivalent to an arbitrarily large lag spike (since time-related functions like pygame.time.get_ticks() aren't affected), there can be some pretty bad effects if you use certain types of game loops.
It messes up the delta time, which leads to either more freezing or physics issues, if your program depends on the delta time.

@oddbookworm
Copy link
Member

It messes up the delta time, which leads to either more freezing or physics issues, if your program depends on the delta time.

A common workaround for this is to cap your delta time. If your frame time exceeds that cap, then artificially set it to the cap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended SDL sdl3 Windows
Projects
None yet
Development

No branches or pull requests

3 participants