mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-18 18:51:08 +03:00
@@ -480,6 +480,7 @@ impl InvokeUiSession for FlutterHandler {
|
||||
features.insert("privacy_mode", 0);
|
||||
}
|
||||
let features = serde_json::ser::to_string(&features).unwrap_or("".to_owned());
|
||||
let resolutions = serialize_resolutions(&pi.resolutions.resolutions);
|
||||
*self.peer_info.write().unwrap() = pi.clone();
|
||||
self.push_event(
|
||||
"peer_info",
|
||||
@@ -492,6 +493,7 @@ impl InvokeUiSession for FlutterHandler {
|
||||
("version", &pi.version),
|
||||
("features", &features),
|
||||
("current_display", &pi.current_display.to_string()),
|
||||
("resolutions", &resolutions),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -529,6 +531,7 @@ impl InvokeUiSession for FlutterHandler {
|
||||
}
|
||||
|
||||
fn switch_display(&self, display: &SwitchDisplay) {
|
||||
let resolutions = serialize_resolutions(&display.resolutions.resolutions);
|
||||
self.push_event(
|
||||
"switch_display",
|
||||
vec![
|
||||
@@ -548,6 +551,7 @@ impl InvokeUiSession for FlutterHandler {
|
||||
}
|
||||
.to_string(),
|
||||
),
|
||||
("resolutions", &resolutions),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -861,6 +865,27 @@ pub fn set_cur_session_id(id: String) {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn serialize_resolutions(resolutions: &Vec<Resolution>) -> String {
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
struct ResolutionSerde {
|
||||
width: i32,
|
||||
height: i32,
|
||||
}
|
||||
|
||||
let mut v = vec![];
|
||||
resolutions
|
||||
.iter()
|
||||
.map(|r| {
|
||||
v.push(ResolutionSerde {
|
||||
width: r.width,
|
||||
height: r.height,
|
||||
})
|
||||
})
|
||||
.count();
|
||||
serde_json::ser::to_string(&v).unwrap_or("".to_string())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
#[cfg(not(feature = "flutter_texture_render"))]
|
||||
pub fn session_get_rgba_size(id: *const char) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user