Fix LSP server staying alive when closing preview window

* Provide an internal behavior parameter to run_event_loop() that we can use
from the preview to not quit when the last window was closed.
* Fix Drop for the winit event loop GraphicsWindow to drop the backend window correctly
  when unmapping, not when the graphics window dies. Otherwise QuitOnLastWindowClosed doesn't work.
This commit is contained in:
Simon Hausmann 2021-04-06 12:11:55 +02:00
parent b81803774b
commit 1e4921de13
9 changed files with 55 additions and 24 deletions

View file

@ -34,7 +34,8 @@ pub unsafe extern "C" fn sixtyfps_component_window_init(out: *mut ComponentWindo
#[no_mangle]
pub unsafe extern "C" fn sixtyfps_run_event_loop() {
crate::backend().run_event_loop();
crate::backend()
.run_event_loop(sixtyfps_corelib::backend::EventLoopQuitBehavior::QuitOnLastWindowClosed);
}
#[no_mangle]