Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
FIX: macosx animations#21768
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
FIX: macosx animations#21768
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The macosx backend would not update on flush_events calls due to theloop being run too fast for the view to update properly in the NSApp.Fix that by adding an unnoticeable RunLoop timer slowdown thatallows the app to see the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Seems okay based on the book, but I guess someone else on macOS should test too.
I'm going to convert this to draft for now. I think#21790 is a better solution and also addresses this issue. |
I'm going to close this in the hopes of#21790 being merged with this commit in it. |
The macosx backend would not update on flush_events calls due to the loop being run too fast for the view to update properly in the NSApp. Fix that by adding an unnoticeable RunLoop timer slowdown that allows the app to see the changes. Putting an
NSLog
into the drawRect loop before and after this produced identical results, taking 0.021 seconds per iteration, but with this addition, the draw update actually happens.It doesn't feel super ideal, but this method is apparently used by others...link to google book
Example from#17642
Closes#17642
PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).