-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 crash when changing viewport settings #4862
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
You probably need to add the same code to
wgpu_integration.rs
.We just merged the update to latest
winit
(#4849), so please merge that into this branch and then test this PR with:cargo r -p test_viewports
cargo r -p test_viewports -F wgpu
cargo r -p serial_windows
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.
will do, note that I found this #4894
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.
@emilk Am I reading this correctly. That clicking the close box on a child viewport does nothing unless I actually have code that checks for CloseRequested? And that you have to set the vp as not visible in order to destroy it . Thats not at all obvious. (Was trying to work out why the bug reporters app was not closing the child VP after I fixed the bugs I could find)
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.
@emilk I added to wgpu the equivalent release of the drawing surface, in wgpu not releasing this resulted in the recreate of the vp leaving the original in place (rather than crashing as in glow).
Tested on windows and mac,
Note the wgpu has very strange defferred vp close behavior (also meaning that I did not need to add any close logic to wpgpu_integration). Because there is no close option only the option to no longer request its presence there is some very odd stuff happening. I worried that it was my bad but the current master shows the same thing. After CloseRequest is received you have to stop drawing secondary vp in update, BUT, this means you need another main window draw before the window disappears. I filed a bug on this #4894 . I tried to add the necessary code to the original reports code but could not - I thought it was simply a matter of doing request_repaint but I could not make that work. And the fact that the test_viewports app shows the same bug shows that its not simple.
I think it would be really ice to have an explicit vp.close call (even though that goes again the immediate model VPs are really not transient, the OS knows them (unlike stuff drawn on the gl surfaces). I will investigate and make a separate PR
Also I have not tested on linux becasue I cannot make it build on linux, it complains about a lot of pkg errors.
I will do a separate PR to add vp calls the need window recreation to test_viewports. Done #4907
In summary - I think this PR is complete, apart from not being tested on Linux.
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.
Thanks!