mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
servoshell: fix unwrap None during RedrawRequested (#30360)
This commit is contained in:
parent
988e05a68b
commit
2076b5d789
1 changed files with 22 additions and 23 deletions
|
@ -173,8 +173,16 @@ impl App {
|
|||
app.windows.insert(window.id(), window.clone());
|
||||
app.servo = Some(servo);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
winit::event::Event::RedrawRequested(_) => {
|
||||
// If self.servo is None here, it means that we're in the process of shutting down,
|
||||
// let's ignore events.
|
||||
if app.servo.is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
if let winit::event::Event::RedrawRequested(_) = e {
|
||||
// We need to redraw the window for some reason.
|
||||
trace!("RedrawRequested");
|
||||
|
||||
|
@ -194,15 +202,6 @@ impl App {
|
|||
|
||||
// By default, the next RedrawRequested event will need to recomposite.
|
||||
need_recomposite = true;
|
||||
},
|
||||
|
||||
_ => {},
|
||||
}
|
||||
|
||||
// If self.servo is None here, it means that we're in the process of shutting down,
|
||||
// let's ignore events.
|
||||
if app.servo.is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle the event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue