refact, separate window, debug

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-08-05 15:02:35 +08:00
parent 01ab0cf196
commit 30c2c92970
2 changed files with 10 additions and 3 deletions

View File

@ -1291,7 +1291,12 @@ impl<T: InvokeUiSession> Remote<T> {
Some(misc::Union::SwitchDisplay(s)) => {
#[cfg(feature = "flutter")]
{
self.handler.cache_flutter.write().unwrap().sp = s.clone();
self.handler
.cache_flutter
.write()
.unwrap()
.sp
.replace(s.clone());
}
self.handler.handle_peer_switch_display(&s);
self.video_sender.send(MediaData::Reset).ok();

View File

@ -52,7 +52,7 @@ const CHANGE_RESOLUTION_VALID_TIMEOUT_SECS: u64 = 15;
#[derive(Default)]
pub struct CacheFlutter {
pub pi: PeerInfo,
pub sp: SwitchDisplay,
pub sp: Option<SwitchDisplay>,
pub cursor_data: HashMap<u64, CursorData>,
pub cursor_id: u64,
}
@ -1197,7 +1197,9 @@ impl<T: InvokeUiSession> Session<T> {
pub fn restore_flutter_cache(&mut self) {
let pi = self.cache_flutter.read().unwrap().pi.clone();
self.handle_peer_info(pi);
self.handle_peer_switch_display(&self.cache_flutter.read().unwrap().sp);
if let Some(sp) = self.cache_flutter.read().unwrap().sp.as_ref() {
self.handle_peer_switch_display(sp);
}
for (_, cd) in self.cache_flutter.read().unwrap().cursor_data.iter() {
self.set_cursor_data(cd.clone());
}