mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-01 23:41:27 +03:00
@@ -449,7 +449,8 @@ class _FileManagerViewState extends State<FileManagerView> {
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: FutureBuilder<String>(
|
||||
future: bind.sessionGetPlatform(
|
||||
id: _ffi.id, isRemote: !isLocal),
|
||||
sessionId: _ffi.sessionId,
|
||||
isRemote: !isLocal),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData &&
|
||||
snapshot.data!.isNotEmpty) {
|
||||
|
||||
@@ -194,7 +194,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
||||
(remoteHostController.text.isEmpty ||
|
||||
remoteHostController.text.trim().isNotEmpty)) {
|
||||
await bind.sessionAddPortForward(
|
||||
id: 'pf_${widget.id}',
|
||||
sessionId: _ffi.sessionId,
|
||||
localPort: localPort,
|
||||
remoteHost: remoteHostController.text.trim().isEmpty
|
||||
? 'localhost'
|
||||
@@ -254,7 +254,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () async {
|
||||
await bind.sessionRemovePortForward(
|
||||
id: 'pf_${widget.id}', localPort: pf.localPort);
|
||||
sessionId: _ffi.sessionId, localPort: pf.localPort);
|
||||
refreshTunnelConfig();
|
||||
},
|
||||
),
|
||||
@@ -313,7 +313,7 @@ class _PortForwardPageState extends State<PortForwardPage>
|
||||
width: 120,
|
||||
child: ElevatedButton(
|
||||
onPressed: () =>
|
||||
bind.sessionNewRdp(id: "pf_${widget.id}"),
|
||||
bind.sessionNewRdp(sessionId: _ffi.sessionId),
|
||||
child: Text(
|
||||
translate('New RDP'),
|
||||
),
|
||||
|
||||
@@ -110,12 +110,12 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
|
||||
return Platform.isMacOS || kUseCompatibleUiMode
|
||||
? tabWidget
|
||||
: Obx(
|
||||
() => SubWindowDragToResizeArea(
|
||||
() => SubWindowDragToResizeArea(
|
||||
child: tabWidget,
|
||||
resizeEdgeSize: stateGlobal.resizeEdgeSize.value,
|
||||
windowId: stateGlobal.windowId,
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
void onRemoveId(String id) {
|
||||
|
||||
@@ -76,6 +76,8 @@ class _RemotePageState extends State<RemotePage>
|
||||
|
||||
late FFI _ffi;
|
||||
|
||||
SessionID get sessionId => _ffi.sessionId;
|
||||
|
||||
void _initStates(String id) {
|
||||
initSharedStates(id);
|
||||
_zoomCursor = PeerBoolOption.find(id, 'zoom-cursor');
|
||||
@@ -117,19 +119,19 @@ class _RemotePageState extends State<RemotePage>
|
||||
debugPrint("id: $id, texture_key: $_textureKey");
|
||||
if (id != -1) {
|
||||
final ptr = await textureRenderer.getTexturePtr(_textureKey);
|
||||
platformFFI.registerTexture(widget.id, ptr);
|
||||
platformFFI.registerTexture(sessionId, ptr);
|
||||
_textureId.value = id;
|
||||
}
|
||||
});
|
||||
}
|
||||
_ffi.ffiModel.updateEventListener(widget.id);
|
||||
_ffi.ffiModel.updateEventListener(sessionId, widget.id);
|
||||
bind.pluginSyncUi(syncTo: kAppTypeDesktopRemote);
|
||||
_ffi.qualityMonitorModel.checkShowQualityMonitor(widget.id);
|
||||
_ffi.qualityMonitorModel.checkShowQualityMonitor(sessionId);
|
||||
// Session option should be set after models.dart/FFI.start
|
||||
_showRemoteCursor.value = bind.sessionGetToggleOptionSync(
|
||||
id: widget.id, arg: 'show-remote-cursor');
|
||||
_zoomCursor.value =
|
||||
bind.sessionGetToggleOptionSync(id: widget.id, arg: 'zoom-cursor');
|
||||
sessionId: sessionId, arg: 'show-remote-cursor');
|
||||
_zoomCursor.value = bind.sessionGetToggleOptionSync(
|
||||
sessionId: sessionId, arg: 'zoom-cursor');
|
||||
DesktopMultiWindow.addListener(this);
|
||||
// if (!_isCustomCursorInited) {
|
||||
// customCursorController.registerNeedUpdateCursorCallback(
|
||||
@@ -203,11 +205,11 @@ class _RemotePageState extends State<RemotePage>
|
||||
void dispose() {
|
||||
debugPrint("REMOTE PAGE dispose ${widget.id}");
|
||||
if (useTextureRender) {
|
||||
platformFFI.registerTexture(widget.id, 0);
|
||||
platformFFI.registerTexture(sessionId, 0);
|
||||
textureRenderer.closeTexture(_textureKey);
|
||||
}
|
||||
// ensure we leave this session, this is a double check
|
||||
bind.sessionEnterOrLeave(id: widget.id, enter: false);
|
||||
bind.sessionEnterOrLeave(sessionId: sessionId, enter: false);
|
||||
DesktopMultiWindow.removeListener(this);
|
||||
_ffi.dialogManager.hideMobileActionsOverlay();
|
||||
_ffi.recordingModel.onClose();
|
||||
@@ -278,7 +280,7 @@ class _RemotePageState extends State<RemotePage>
|
||||
super.build(context);
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
clientClose(widget.id, _ffi.dialogManager);
|
||||
clientClose(sessionId, _ffi.dialogManager);
|
||||
return false;
|
||||
},
|
||||
child: MultiProvider(providers: [
|
||||
@@ -305,7 +307,7 @@ class _RemotePageState extends State<RemotePage>
|
||||
if (!_rawKeyFocusNode.hasFocus) {
|
||||
_rawKeyFocusNode.requestFocus();
|
||||
}
|
||||
bind.sessionEnterOrLeave(id: widget.id, enter: true);
|
||||
bind.sessionEnterOrLeave(sessionId: sessionId, enter: true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +327,7 @@ class _RemotePageState extends State<RemotePage>
|
||||
}
|
||||
// See [onWindowBlur].
|
||||
if (!Platform.isWindows) {
|
||||
bind.sessionEnterOrLeave(id: widget.id, enter: false);
|
||||
bind.sessionEnterOrLeave(sessionId: sessionId, enter: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,11 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
if (peerId != null) {
|
||||
ConnectionTypeState.init(peerId);
|
||||
tabController.onSelected = (_, id) {
|
||||
bind.setCurSessionId(id: id);
|
||||
final remotePage = tabController.state.value.tabs
|
||||
.firstWhere((tab) => tab.key == id)
|
||||
.page as RemotePage;
|
||||
final ffi = remotePage.ffi;
|
||||
bind.setCurSessionId(sessionId: ffi.sessionId);
|
||||
WindowController.fromWindowId(windowId())
|
||||
.setTitle(getWindowNameWithId(id));
|
||||
};
|
||||
@@ -243,6 +247,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
final ffi = remotePage.ffi;
|
||||
final pi = ffi.ffiModel.pi;
|
||||
final perms = ffi.ffiModel.permissions;
|
||||
final sessionId = ffi.sessionId;
|
||||
menu.addAll([
|
||||
MenuEntryButton<String>(
|
||||
childBuilder: (TextStyle? style) => Text(
|
||||
@@ -282,6 +287,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
menu.add(MenuEntryDivider<String>());
|
||||
menu.add(RemoteMenuEntry.showRemoteCursor(
|
||||
key,
|
||||
sessionId,
|
||||
padding,
|
||||
dismissFunc: cancelFunc,
|
||||
));
|
||||
@@ -289,15 +295,15 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
|
||||
if (perms['keyboard'] != false && !ffi.ffiModel.viewOnly) {
|
||||
if (perms['clipboard'] != false) {
|
||||
menu.add(RemoteMenuEntry.disableClipboard(key, padding,
|
||||
menu.add(RemoteMenuEntry.disableClipboard(sessionId, padding,
|
||||
dismissFunc: cancelFunc));
|
||||
}
|
||||
|
||||
menu.add(
|
||||
RemoteMenuEntry.insertLock(key, padding, dismissFunc: cancelFunc));
|
||||
menu.add(RemoteMenuEntry.insertLock(sessionId, padding,
|
||||
dismissFunc: cancelFunc));
|
||||
|
||||
if (pi.platform == kPeerPlatformLinux || pi.sasEnabled) {
|
||||
menu.add(RemoteMenuEntry.insertCtrlAltDel(key, padding,
|
||||
menu.add(RemoteMenuEntry.insertCtrlAltDel(sessionId, padding,
|
||||
dismissFunc: cancelFunc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class _DesktopServerPageState extends State<DesktopServerPage>
|
||||
final tabController = gFFI.serverModel.tabController;
|
||||
@override
|
||||
void initState() {
|
||||
gFFI.ffiModel.updateEventListener("");
|
||||
gFFI.ffiModel.updateEventListener(gFFI.sessionId, "");
|
||||
windowManager.addListener(this);
|
||||
tabController.onRemoved = (_, id) {
|
||||
onRemoveId(id);
|
||||
|
||||
Reference in New Issue
Block a user