-
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: When the program is minimized, the viewport stops working. #4487
Closed
Closed
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc130b5
Update glow_integration.rs
rustbasic 7442edc
Update wgpu_integration.rs
rustbasic dc82f7e
Update glow_integration.rs
rustbasic 4810948
Update glow_integration.rs
rustbasic 082bd29
Update glow_integration.rs
rustbasic 374434d
Update glow_integration.rs
rustbasic bf2bf28
Update glow_integration.rs
rustbasic 69f9be2
Update wgpu_integration.rs
rustbasic 79d179a
Update glow_integration.rs
rustbasic 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
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -525,7 +525,7 @@ impl WgpuWinitRunning { | |||
fn run_ui_and_paint(&mut self, window_id: WindowId) -> EventResult { | ||||
crate::profile_function!(); | ||||
|
||||
let Some(viewport_id) = self | ||||
let Some(mut viewport_id) = self | ||||
.shared | ||||
.borrow() | ||||
.viewport_from_window | ||||
|
@@ -555,20 +555,20 @@ impl WgpuWinitRunning { | |||
viewports, painter, .. | ||||
} = &mut *shared_lock; | ||||
|
||||
if viewport_id != ViewportId::ROOT { | ||||
let Some(viewport) = viewports.get(&viewport_id) else { | ||||
let Some(original_viewport) = viewports.get(&viewport_id) else { | ||||
return EventResult::Wait; | ||||
}; | ||||
|
||||
// This will only happens when a Immediate Viewport. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
if original_viewport.class == ViewportClass::Immediate { | ||||
let Some(parent_viewport) = viewports.get(&original_viewport.ids.parent) else { | ||||
return EventResult::Wait; | ||||
}; | ||||
|
||||
if viewport.viewport_ui_cb.is_none() { | ||||
// This will only happen if this is an immediate viewport. | ||||
// That means that the viewport cannot be rendered by itself and needs his parent to be rendered. | ||||
if let Some(viewport) = viewports.get(&viewport.ids.parent) { | ||||
if let Some(window) = viewport.window.as_ref() { | ||||
return EventResult::RepaintNext(window.id()); | ||||
} | ||||
} | ||||
return EventResult::Wait; | ||||
if parent_viewport.class == ViewportClass::Deferred { | ||||
viewport_id = parent_viewport.ids.this; | ||||
} else { | ||||
viewport_id = ViewportId::ROOT; | ||||
} | ||||
} | ||||
|
||||
|
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.
Dead comment?