Merge pull request #331 from fufesou/master

add error log for graphics failure
This commit is contained in:
RustDesk 2021-12-20 13:26:56 +08:00 committed by GitHub
commit 07ea52d620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,8 @@ struct UI(
Arc<Mutex<HashMap<String, String>>>, Arc<Mutex<HashMap<String, String>>>,
); );
struct UIHostHandler;
fn get_msgbox() -> String { fn get_msgbox() -> String {
#[cfg(feature = "inline")] #[cfg(feature = "inline")]
return inline::get_msgbox(); return inline::get_msgbox();
@ -86,10 +88,12 @@ pub fn start(args: &mut [String]) {
std::thread::spawn(move || check_zombie(cloned)); std::thread::spawn(move || check_zombie(cloned));
crate::common::check_software_update(); crate::common::check_software_update();
frame.event_handler(UI::new(childs)); frame.event_handler(UI::new(childs));
frame.sciter_handler(UIHostHandler {});
page = "index.html"; page = "index.html";
} else if args[0] == "--install" { } else if args[0] == "--install" {
let childs: Childs = Default::default(); let childs: Childs = Default::default();
frame.event_handler(UI::new(childs)); frame.event_handler(UI::new(childs));
frame.sciter_handler(UIHostHandler {});
page = "install.html"; page = "install.html";
} else if args[0] == "--cm" { } else if args[0] == "--cm" {
frame.register_behavior("connection-manager", move || { 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) { pub fn check_zombie(childs: Childs) {
let mut deads = Vec::new(); let mut deads = Vec::new();
loop { loop {