mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
refact: option, touch mode, move to local (#13055)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -1107,9 +1107,20 @@ class FfiModel with ChangeNotifier {
|
||||
if (isPeerAndroid) {
|
||||
_touchMode = true;
|
||||
} else {
|
||||
_touchMode = await bind.sessionGetOption(
|
||||
sessionId: sessionId, arg: kOptionTouchMode) !=
|
||||
'';
|
||||
// `kOptionTouchMode` is originally peer option, but it is moved to local option later.
|
||||
// We check local option first, if not set, then check peer option.
|
||||
// Because if local option is not empty:
|
||||
// 1. User has set the touch mode explicitly.
|
||||
// 2. The advanced option (custom client) is set.
|
||||
// Then we choose to use the local option.
|
||||
final optLocal = bind.mainGetLocalOption(key: kOptionTouchMode);
|
||||
if (optLocal != '') {
|
||||
_touchMode = optLocal == 'Y';
|
||||
} else {
|
||||
final optSession = await bind.sessionGetOption(
|
||||
sessionId: sessionId, arg: kOptionTouchMode);
|
||||
_touchMode = optSession != '';
|
||||
}
|
||||
}
|
||||
if (isMobile) {
|
||||
virtualMouseMode.loadOptions();
|
||||
|
||||
Reference in New Issue
Block a user