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

Fix timer not firing on Windows #3876

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Fix timer not firing on Windows #3876

merged 1 commit into from
Nov 8, 2023

Conversation

ogoffart
Copy link
Member

@ogoffart ogoffart commented Nov 7, 2023

If we set the control flow to Wait, winit will always wait even if we set the control flow later to some smaller timeout in the AboutToWait event.
Wait is the default anyway in winit 0.29 so this is not required

I'd say this is a bug in winit, but we can easily work it around

Fix #3875

Copy link
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very weird that this … works. Any idea why?

@ogoffart
Copy link
Member Author

ogoffart commented Nov 7, 2023

Wait is the default anyway in winit 0.29 so this is not required

No this is wrong. the default on windows is whatever was set last.

Any idea why?

It works because the patch is wrong, and with this we would never wait.

I think the bug is really in winit

On Windows, winit doesn't respect the set_control_flow from the
AboutToWait event.
This is a bug in winit, but we can easily work it around

Fix #3875
@ogoffart
Copy link
Member Author

ogoffart commented Nov 7, 2023

Made a new patch

@ogoffart
Copy link
Member Author

ogoffart commented Nov 8, 2023

rust-windowing/winit#3216 was merged. But I'll merge this as well so we have a fix for the release. Will revert once next version of winit is released

@ogoffart ogoffart merged commit 1f5f07f into master Nov 8, 2023
31 checks passed
@ogoffart ogoffart deleted the olivier/fix-3875 branch November 8, 2023 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timer example does not work correctly on current branch
2 participants