mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
add custom client option to allow remote cm modification (#8660)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -135,6 +135,7 @@ const String kOptionAllowLinuxHeadless = "allow-linux-headless";
|
||||
const String kOptionAllowRemoveWallpaper = "allow-remove-wallpaper";
|
||||
const String kOptionStopService = "stop-service";
|
||||
const String kOptionDirectxCapture = "enable-directx-capture";
|
||||
const String kOptionAllowRemoteCmModification = "allow-remote-cm-modification";
|
||||
|
||||
const String kOptionToggleViewOnly = "view-only";
|
||||
|
||||
|
||||
@@ -112,7 +112,9 @@ class ConnectionManagerState extends State<ConnectionManager>
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
super.didChangeAppLifecycleState(state);
|
||||
if (state == AppLifecycleState.resumed) {
|
||||
shouldBeBlocked(_block, null);
|
||||
if (!allowRemoteCMModification()) {
|
||||
shouldBeBlocked(_block, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +185,7 @@ class ConnectionManagerState extends State<ConnectionManager>
|
||||
selectedBorderColor: MyTheme.accent,
|
||||
maxLabelWidth: 100,
|
||||
tail: null, //buildScrollJumper(),
|
||||
blockTab: _block,
|
||||
blockTab: allowRemoteCMModification() ? null : _block,
|
||||
selectedTabBackgroundColor:
|
||||
Theme.of(context).hintColor.withOpacity(0),
|
||||
tabBuilder: (key, icon, label, themeConf) {
|
||||
@@ -226,10 +228,12 @@ class ConnectionManagerState extends State<ConnectionManager>
|
||||
Consumer<ChatModel>(
|
||||
builder: (_, model, child) => SizedBox(
|
||||
width: realChatPageWidth,
|
||||
child: buildRemoteBlock(
|
||||
child: buildSidePage(),
|
||||
block: _block,
|
||||
mask: true),
|
||||
child: allowRemoteCMModification()
|
||||
? buildSidePage()
|
||||
: buildRemoteBlock(
|
||||
child: buildSidePage(),
|
||||
block: _block,
|
||||
mask: true),
|
||||
)),
|
||||
SizedBox(
|
||||
width: realClosedWidth,
|
||||
@@ -1057,6 +1061,10 @@ class _CmControlPanel extends StatelessWidget {
|
||||
}
|
||||
|
||||
void checkClickTime(int id, Function() callback) async {
|
||||
if (allowRemoteCMModification()) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
var clickCallbackTime = DateTime.now().millisecondsSinceEpoch;
|
||||
await bind.cmCheckClickTime(connId: id);
|
||||
Timer(const Duration(milliseconds: 120), () async {
|
||||
@@ -1065,6 +1073,11 @@ void checkClickTime(int id, Function() callback) async {
|
||||
});
|
||||
}
|
||||
|
||||
bool allowRemoteCMModification() {
|
||||
return option2bool(kOptionAllowRemoteCmModification,
|
||||
bind.mainGetLocalOption(key: kOptionAllowRemoteCmModification));
|
||||
}
|
||||
|
||||
class _FileTransferLogPage extends StatefulWidget {
|
||||
_FileTransferLogPage({Key? key}) : super(key: key);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user