tmp commit

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-08-04 01:41:36 +08:00
parent e12d0ef4aa
commit 53e87352da
7 changed files with 30 additions and 7 deletions

View File

@@ -1008,6 +1008,10 @@ impl<T: InvokeUiSession> Remote<T> {
}
}
Some(login_response::Union::PeerInfo(pi)) => {
#[cfg(feature = "flutter")]
{
self.handler.pi = pi.clone();
}
self.handler.handle_peer_info(pi);
#[cfg(not(feature = "flutter"))]
self.check_clipboard_file_context();
@@ -1274,6 +1278,10 @@ impl<T: InvokeUiSession> Remote<T> {
}
}
Some(misc::Union::SwitchDisplay(s)) => {
#[cfg(feature = "flutter")]
{
self.handler.switch_display = s.clone();
}
self.handler.handle_peer_switch_display(&s);
self.video_sender.send(MediaData::Reset).ok();
if s.width > 0 && s.height > 0 {

View File

@@ -1,7 +1,7 @@
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::common::get_default_sound_input;
use crate::{
client::file_trait::FileManager,
client::{file_trait::FileManager, Interface},
common::is_keyboard_mode_supported,
common::make_fd_to_json,
flutter::{self, SESSIONS},
@@ -601,6 +601,13 @@ pub fn session_change_resolution(session_id: SessionID, display: i32, width: i32
}
}
pub fn session_handle_peer_info(session_id: SessionID) {
if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) {
session.handle_peer_info(session.pi.clone());
session.handle_peer_switch_display(&session.switch_display);
}
}
pub fn session_set_size(_session_id: SessionID, _width: usize, _height: usize) {
#[cfg(feature = "flutter_texture_render")]
if let Some(session) = SESSIONS.write().unwrap().get_mut(&_session_id) {

View File

@@ -62,6 +62,10 @@ pub struct Session<T: InvokeUiSession> {
pub server_file_transfer_enabled: Arc<RwLock<bool>>,
pub server_clipboard_enabled: Arc<RwLock<bool>>,
pub last_change_display: Arc<Mutex<ChangeDisplayRecord>>,
#[cfg(feature = "flutter")]
pub pi: PeerInfo,
#[cfg(feature = "flutter")]
pub switch_display: SwitchDisplay,
}
#[derive(Clone)]
@@ -1186,7 +1190,7 @@ impl<T: InvokeUiSession> Session<T> {
#[tokio::main(flavor = "current_thread")]
pub async fn io_loop<T: InvokeUiSession>(handler: Session<T>) {
// It is ok to call this function multiple times.
#[cfg(target_os ="windows")]
#[cfg(target_os = "windows")]
if !handler.is_file_transfer() && !handler.is_port_forward() {
clipboard::ContextSend::enable(true);
}