Windows: move prepare_wait before querying the control_flow#3216
Merged
kchibisov merged 1 commit intorust-windowing:masterfrom Nov 8, 2023
slint-ui:fix-3215
Merged
Windows: move prepare_wait before querying the control_flow#3216kchibisov merged 1 commit intorust-windowing:masterfrom slint-ui:fix-3215
kchibisov merged 1 commit intorust-windowing:masterfrom
slint-ui:fix-3215
Conversation
kchibisov
requested changes
Nov 7, 2023
Comment on lines
+363
to
+373
| // We aim to be consistent with the MacOS backend which has a RunLoop | ||
| // observer that will dispatch AboutToWait when about to wait for | ||
| // events, and NewEvents after the RunLoop wakes up. | ||
| // | ||
| // We emulate similar behaviour by treating `GetMessage` as our wait | ||
| // point and wake up point (when it returns) and we drain all other | ||
| // pending messages via `PeekMessage` until we come back to "wait" via | ||
| // `GetMessage` | ||
| // | ||
| runner.prepare_wait(); | ||
|
|
Member
There was a problem hiding this comment.
I don't quite like the way it's structured in this function. Could you instead move the timeout calculation to the place it's actually being used? So basically revert your code and move the let control_flow_timeout part.
Contributor
Author
There was a problem hiding this comment.
done. Also moved the computation of start nearer to where it is used. This is not strictly equivalent as time can pass while prepare_wait is being called. But i think this is fine.
In case the AboutToWait event sets the control flow to another value Fixes #3215
kchibisov
approved these changes
Nov 7, 2023
Member
|
You've tested that it fixes your issue, right? |
Contributor
Author
Yes |
msiglreith
approved these changes
Nov 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case the AboutToWait event sets the control flow to another value
Fixes #3215
CHANGELOG.mdif knowledge of this change could be valuable to users