auto merge of #5276 : metajack/servo/fix-idle-loop, r=pcwalton

This fixes 100% CPU usage during idle.
This commit is contained in:
bors-servo 2015-03-19 12:03:52 -06:00
commit e845695b66
4 changed files with 7 additions and 14 deletions

View file

@ -350,7 +350,7 @@ dependencies = [
[[package]]
name = "glutin"
version = "0.0.7"
source = "git+https://github.com/servo/glutin#183d96b44e497fcc441f94d32d5228e4c3d28c4d"
source = "git+https://github.com/servo/glutin?branch=servo#8138fe5755aa1b23fee704994d52597109f1abe0"
dependencies = [
"android_glue 0.0.1 (git+https://github.com/tomaka/android-rs-glue)",
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
@ -376,7 +376,7 @@ dependencies = [
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glutin 0.0.7 (git+https://github.com/servo/glutin)",
"glutin 0.0.7 (git+https://github.com/servo/glutin?branch=servo)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",

4
ports/cef/Cargo.lock generated
View file

@ -356,7 +356,7 @@ dependencies = [
[[package]]
name = "glutin"
version = "0.0.7"
source = "git+https://github.com/servo/glutin#183d96b44e497fcc441f94d32d5228e4c3d28c4d"
source = "git+https://github.com/servo/glutin?branch=servo#8138fe5755aa1b23fee704994d52597109f1abe0"
dependencies = [
"android_glue 0.0.1 (git+https://github.com/tomaka/android-rs-glue)",
"cocoa 0.1.1 (git+https://github.com/servo/rust-cocoa)",
@ -382,7 +382,7 @@ dependencies = [
"egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glutin 0.0.7 (git+https://github.com/servo/glutin)",
"glutin 0.0.7 (git+https://github.com/servo/glutin?branch=servo)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",

View file

@ -28,6 +28,7 @@ path = "../../components/util"
[dependencies.glutin]
git = "https://github.com/servo/glutin"
branch = "servo"
[dependencies.gleam]
git = "https://github.com/servo/gleam"

View file

@ -271,16 +271,8 @@ impl Window {
}
}
} else {
// GWTODO: Something has changed in the wait_events
// behaviour in glutin. Switching to poll events
// for now, so that things display correctly,
// need to fix glutin / handle the changed behaviour.
for event in self.window.poll_events() {
close_event = self.handle_window_event(event);
if close_event {
break;
}
}
let event = self.window.wait_events().next().unwrap();
close_event = self.handle_window_event(event);
}
if close_event || self.window.is_closed() {