Please have a look at the warnings in the comments:
Wth is that, that is the most anti-idiomatic code I have ever seen
https://github.com/rustdesk/rustdesk/blob/master/src%2Fplatform%2Flinux.rs#L176
pub fn get_cursor() -> ResultType<Option<u64>> {
let mut res = None;
DISPLAY.with(|conn| {
if let Ok(d) = conn.try_borrow_mut() {
if !d.is_null() {
unsafe {
let img = XFixesGetCursorImage(*d);
if !img.is_null() {
res = Some((*img).cursor_serial as u64);
XFree(img as _);
}
}
}
}
});
Ok(res)
}
I’m not an expert but this seems wrong.
Yep, I’m not a Rust expert either, but this is pretty cursed. The comments on this post have some more examples of bad rustdesk code: https://lobste.rs/s/njfvjb/rustdesk_with_tailscale_on_arch_linux