Reduce flashing on window creation#1272
Merged
jneem merged 1 commit intolinebender:masterfrom Oct 28, 2020
rhzk:reduce_flashing
Merged
Reduce flashing on window creation#1272jneem merged 1 commit intolinebender:masterfrom rhzk:reduce_flashing
jneem merged 1 commit intolinebender:masterfrom
rhzk:reduce_flashing
Conversation
raphlinus
approved these changes
Oct 12, 2020
Contributor
raphlinus
left a comment
There was a problem hiding this comment.
Looks good, one small concern inline. I agree that the synchronous call to SetWindowPos in the window creation call is the best way to solve this.
|
|
||
| let position = match self.position { | ||
| Some(pos) => pos, | ||
| None => Point::new(CW_USEDEFAULT as f64, CW_USEDEFAULT as f64), |
Contributor
There was a problem hiding this comment.
I am slightly uncomfortable with CW_USEDEFAULT being converted into f64. I know it's going to work, but feels like it's not quite the right type for the job.
Would it work for position to be (i32, i32) here?
Collaborator
Author
There was a problem hiding this comment.
Good catch, makes more sense to cast self.position to i32
Contributor
|
Any reason not to merge this now? There are no conflicts, and I've verified again that it works on my machine. |
Member
|
I'm guessing it's because @rhzk doesn't have write access? |
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.
Sets the correct window size directly after the window is built instead of adding it to the deferred queue.
Since this is done before ShowWindow is called it should not be any visible "flashing" occuring.
Updated Show() to handle maximized and minimized window, as this was also deferred and might have caused flashing.