Fix recurring C++ timers

* sixtyfps_timer_start needs to *take* the timer id out of the Rust
  timer to avoid that the subsequent drop stops the timer again
* For the Qt event loop, call `timer_event()` once before entering
  QCoreApplication::exec(), to schedule any timers that were started
  beforehand.
* Added a way to quit the event loop gently, in order to use that
  from the C++ unit test.
This commit is contained in:
Simon Hausmann 2021-03-25 18:31:46 +01:00
parent f4ed0e333b
commit 4cbcf2611f
10 changed files with 50 additions and 2 deletions

View file

@ -37,6 +37,11 @@ pub unsafe extern "C" fn sixtyfps_run_event_loop() {
crate::backend().run_event_loop();
}
#[no_mangle]
pub unsafe extern "C" fn sixtyfps_quit_event_loop() {
crate::backend().quit_event_loop();
}
#[no_mangle]
pub unsafe extern "C" fn sixtyfps_register_font_from_path(
path: &sixtyfps_corelib::SharedString,