tmp commit
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
53e87352da
commit
fd12f69afa
@ -326,9 +326,9 @@ class _GeneralState extends State<_General> {
|
|||||||
update: () {
|
update: () {
|
||||||
final useSeparateWindow =
|
final useSeparateWindow =
|
||||||
mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow);
|
mainGetLocalBoolOptionSync(kOptionSeparateRemoteWindow);
|
||||||
if (useSeparateWindow) {
|
// if (useSeparateWindow) {
|
||||||
rustDeskWinManager.separateWindows();
|
rustDeskWinManager.separateWindows();
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
@ -1655,9 +1655,15 @@ class FFI {
|
|||||||
final stream = bind.sessionStart(sessionId: sessionId, id: id);
|
final stream = bind.sessionStart(sessionId: sessionId, id: id);
|
||||||
final cb = ffiModel.startEventListener(sessionId, id);
|
final cb = ffiModel.startEventListener(sessionId, id);
|
||||||
final useTextureRender = bind.mainUseTextureRender();
|
final useTextureRender = bind.mainUseTextureRender();
|
||||||
|
|
||||||
|
final SimpleWrapper<bool> isPeerInfoSent = SimpleWrapper(false);
|
||||||
// Preserved for the rgba data.
|
// Preserved for the rgba data.
|
||||||
stream.listen((message) {
|
stream.listen((message) {
|
||||||
if (closed) return;
|
if (closed) return;
|
||||||
|
if (isSessionAdded && !isPeerInfoSent.value) {
|
||||||
|
bind.sessionHandlePeerInfo(sessionId: sessionId);
|
||||||
|
isPeerInfoSent.value = true;
|
||||||
|
}
|
||||||
() async {
|
() async {
|
||||||
if (message is EventToUI_Event) {
|
if (message is EventToUI_Event) {
|
||||||
if (message.field0 == "close") {
|
if (message.field0 == "close") {
|
||||||
@ -1702,10 +1708,6 @@ class FFI {
|
|||||||
});
|
});
|
||||||
// every instance will bind a stream
|
// every instance will bind a stream
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
||||||
if (isSessionAdded) {
|
|
||||||
bind.sessionHandlePeerInfo(sessionId: sessionId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Login with [password], choose if the client should [remember] it.
|
/// Login with [password], choose if the client should [remember] it.
|
||||||
|
@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_hbb/consts.dart';
|
import 'package:flutter_hbb/consts.dart';
|
||||||
import 'package:flutter_hbb/common.dart';
|
import 'package:flutter_hbb/common.dart';
|
||||||
|
import 'package:flutter_hbb/models/platform_model.dart';
|
||||||
|
|
||||||
/// must keep the order
|
/// must keep the order
|
||||||
enum WindowType { Main, RemoteDesktop, FileTransfer, PortForward, Unknown }
|
enum WindowType { Main, RemoteDesktop, FileTransfer, PortForward, Unknown }
|
||||||
@ -48,10 +49,10 @@ class RustDeskMultiWindowManager {
|
|||||||
final String sessionIdList = await DesktopMultiWindow.invokeMethod(
|
final String sessionIdList = await DesktopMultiWindow.invokeMethod(
|
||||||
windowId, kWindowEventGetSessionIdList, null);
|
windowId, kWindowEventGetSessionIdList, null);
|
||||||
final idList = sessionIdList.split(';');
|
final idList = sessionIdList.split(';');
|
||||||
if (idList.length <= 1) {
|
// if (idList.length <= 1) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
for (final idPair in idList.sublist(1)) {
|
for (final idPair in idList) {
|
||||||
final peerSession = idPair.split(',');
|
final peerSession = idPair.split(',');
|
||||||
var params = {
|
var params = {
|
||||||
'type': WindowType.RemoteDesktop.index,
|
'type': WindowType.RemoteDesktop.index,
|
||||||
|
@ -1010,7 +1010,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
|||||||
Some(login_response::Union::PeerInfo(pi)) => {
|
Some(login_response::Union::PeerInfo(pi)) => {
|
||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
{
|
{
|
||||||
self.handler.pi = pi.clone();
|
*self.handler.pi.write().unwrap() = pi.clone();
|
||||||
}
|
}
|
||||||
self.handler.handle_peer_info(pi);
|
self.handler.handle_peer_info(pi);
|
||||||
#[cfg(not(feature = "flutter"))]
|
#[cfg(not(feature = "flutter"))]
|
||||||
@ -1280,7 +1280,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
|||||||
Some(misc::Union::SwitchDisplay(s)) => {
|
Some(misc::Union::SwitchDisplay(s)) => {
|
||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
{
|
{
|
||||||
self.handler.switch_display = s.clone();
|
*self.handler.switch_display.write().unwrap() = s.clone();
|
||||||
}
|
}
|
||||||
self.handler.handle_peer_switch_display(&s);
|
self.handler.handle_peer_switch_display(&s);
|
||||||
self.video_sender.send(MediaData::Reset).ok();
|
self.video_sender.send(MediaData::Reset).ok();
|
||||||
|
@ -603,8 +603,9 @@ pub fn session_change_resolution(session_id: SessionID, display: i32, width: i32
|
|||||||
|
|
||||||
pub fn session_handle_peer_info(session_id: SessionID) {
|
pub fn session_handle_peer_info(session_id: SessionID) {
|
||||||
if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) {
|
if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) {
|
||||||
session.handle_peer_info(session.pi.clone());
|
let pi = session.pi.read().unwrap().clone();
|
||||||
session.handle_peer_switch_display(&session.switch_display);
|
session.handle_peer_info(pi);
|
||||||
|
session.handle_peer_switch_display(&session.switch_display.read().unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,9 +63,9 @@ pub struct Session<T: InvokeUiSession> {
|
|||||||
pub server_clipboard_enabled: Arc<RwLock<bool>>,
|
pub server_clipboard_enabled: Arc<RwLock<bool>>,
|
||||||
pub last_change_display: Arc<Mutex<ChangeDisplayRecord>>,
|
pub last_change_display: Arc<Mutex<ChangeDisplayRecord>>,
|
||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
pub pi: PeerInfo,
|
pub pi: Arc<RwLock<PeerInfo>>,
|
||||||
#[cfg(feature = "flutter")]
|
#[cfg(feature = "flutter")]
|
||||||
pub switch_display: SwitchDisplay,
|
pub switch_display: Arc<RwLock<SwitchDisplay>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user