mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
// Block until the window gets an event
|
||||||
if !animating || app.suspended.get() {
|
if !animating || app.suspended.get() {
|
||||||
*control_flow = winit::event_loop::ControlFlow::Wait;
|
control_flow.set_wait();
|
||||||
} else {
|
} else {
|
||||||
*control_flow = winit::event_loop::ControlFlow::Poll;
|
control_flow.set_poll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Consume and handle any events from the Minibrowser.
|
// Consume and handle any events from the Minibrowser.
|
||||||
|
@ -281,7 +281,7 @@ impl App {
|
||||||
|
|
||||||
match app.handle_events() {
|
match app.handle_events() {
|
||||||
PumpResult::Shutdown => {
|
PumpResult::Shutdown => {
|
||||||
*control_flow = winit::event_loop::ControlFlow::Exit;
|
control_flow.set_exit();
|
||||||
app.servo.take().unwrap().deinit();
|
app.servo.take().unwrap().deinit();
|
||||||
if let Some(mut minibrowser) = app.minibrowser() {
|
if let Some(mut minibrowser) = app.minibrowser() {
|
||||||
minibrowser.context.destroy();
|
minibrowser.context.destroy();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue