Simplify event loop start-up

Move the layout constraint tracker into the window where we can apply
the constraints right before drawing, instead of doing that from within
the event loop. This allows to remove the component parameter from the
run function.
This commit is contained in:
Simon Hausmann 2020-11-12 11:14:04 +01:00
parent f8e5982ab4
commit c258a907f0
8 changed files with 57 additions and 66 deletions

View file

@ -329,7 +329,7 @@ declare_types! {
let component = cx.borrow(&mut this, |x| x.0.clone());
let component = component.ok_or(()).or_else(|()| cx.throw_error("Invalid type"))?;
run_scoped(&mut cx,this.downcast().unwrap(), || {
component.window().run(&vtable::VRc::into_dyn(component));
component.window().run();
Ok(())
})?;
Ok(JsUndefined::new().as_value(&mut cx))