diff --git a/src/ui.rs b/src/ui.rs index af6c0849f..8d68c833e 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -29,6 +29,8 @@ struct UI( Arc>>, ); +struct UIHostHandler; + fn get_msgbox() -> String { #[cfg(feature = "inline")] return inline::get_msgbox(); @@ -86,10 +88,12 @@ pub fn start(args: &mut [String]) { std::thread::spawn(move || check_zombie(cloned)); crate::common::check_software_update(); frame.event_handler(UI::new(childs)); + frame.sciter_handler(UIHostHandler {}); page = "index.html"; } else if args[0] == "--install" { let childs: Childs = Default::default(); frame.event_handler(UI::new(childs)); + frame.sciter_handler(UIHostHandler {}); page = "install.html"; } else if args[0] == "--cm" { frame.register_behavior("connection-manager", move || { @@ -612,6 +616,12 @@ impl sciter::EventHandler for UI { } } +impl sciter::host::HostHandler for UIHostHandler { + fn on_graphics_critical_failure(&mut self) { + log::error!("Critical rendering error: e.g. DirectX gfx driver error. Most probably bad gfx drivers."); + } +} + pub fn check_zombie(childs: Childs) { let mut deads = Vec::new(); loop {