mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Modernize servo.rs
This commit is contained in:
parent
7ec7daf585
commit
663ffdc5a9
1 changed files with 13 additions and 10 deletions
|
@ -36,17 +36,20 @@ fn main(args: [str]) {
|
|||
// The content task
|
||||
let content = content::content(layout);
|
||||
|
||||
// The keyboard handler
|
||||
let key_po = port();
|
||||
send(osmain, platform::osmain::add_key_handler(chan(key_po)));
|
||||
// Wait for keypress
|
||||
listen {|key_ch|
|
||||
send(osmain, platform::osmain::add_key_handler(key_ch));
|
||||
|
||||
key_po.recv();
|
||||
comm::send(content, content::exit);
|
||||
comm::send(layout, layout::layout::exit);
|
||||
key_ch.recv();
|
||||
}
|
||||
|
||||
let draw_exit_confirm_po = comm::port();
|
||||
comm::send(renderer, gfx::renderer::exit(comm::chan(draw_exit_confirm_po)));
|
||||
// Shut everything down
|
||||
content.send(content::exit);
|
||||
layout.send(layout::layout::exit);
|
||||
|
||||
comm::recv(draw_exit_confirm_po);
|
||||
comm::send(osmain, platform::osmain::exit);
|
||||
listen {|wait_ch|
|
||||
renderer.send(gfx::renderer::exit(wait_ch));
|
||||
wait_ch.recv();
|
||||
}
|
||||
osmain.send(platform::osmain::exit);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue