mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
feat: use set_poll, set_wait, set_exit of control_flow (#32012)
Co-authored-by: xiandu.wl <xiandu.wl@antgroup.com>
This commit is contained in:
parent
0a8b461dbc
commit
8d513cf4c7
1 changed files with 3 additions and 3 deletions
|
@ -267,9 +267,9 @@ impl App {
|
|||
|
||||
// Block until the window gets an event
|
||||
if !animating || app.suspended.get() {
|
||||
*control_flow = winit::event_loop::ControlFlow::Wait;
|
||||
control_flow.set_wait();
|
||||
} else {
|
||||
*control_flow = winit::event_loop::ControlFlow::Poll;
|
||||
control_flow.set_poll();
|
||||
}
|
||||
|
||||
// Consume and handle any events from the Minibrowser.
|
||||
|
@ -281,7 +281,7 @@ impl App {
|
|||
|
||||
match app.handle_events() {
|
||||
PumpResult::Shutdown => {
|
||||
*control_flow = winit::event_loop::ControlFlow::Exit;
|
||||
control_flow.set_exit();
|
||||
app.servo.take().unwrap().deinit();
|
||||
if let Some(mut minibrowser) = app.minibrowser() {
|
||||
minibrowser.context.destroy();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue