mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-10 20:23:07 +08:00
platform additions
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
ea584c2eb9
commit
1d122b5a73
@ -259,7 +259,9 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
|||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!ffi.canvasModel.cursorEmbedded && !ffi.ffiModel.viewOnly) {
|
if (!ffi.canvasModel.cursorEmbedded &&
|
||||||
|
!ffi.ffiModel.viewOnly &&
|
||||||
|
!pi.is_wayland) {
|
||||||
menu.add(MenuEntryDivider<String>());
|
menu.add(MenuEntryDivider<String>());
|
||||||
menu.add(RemoteMenuEntry.showRemoteCursor(
|
menu.add(RemoteMenuEntry.showRemoteCursor(
|
||||||
key,
|
key,
|
||||||
|
@ -1684,6 +1684,9 @@ class _KeyboardMenu extends StatelessWidget {
|
|||||||
|
|
||||||
for (KeyboardModeMenu mode in modes) {
|
for (KeyboardModeMenu mode in modes) {
|
||||||
if (bind.sessionIsKeyboardModeSupported(id: id, mode: mode.key)) {
|
if (bind.sessionIsKeyboardModeSupported(id: id, mode: mode.key)) {
|
||||||
|
if (pi.is_wayland && mode.key != _kKeyMapMode) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (mode.key == _kKeyTranslateMode) {
|
if (mode.key == _kKeyTranslateMode) {
|
||||||
if (Platform.isLinux) {
|
if (Platform.isLinux) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1059,7 +1059,7 @@ void showOptions(
|
|||||||
final toggles = [
|
final toggles = [
|
||||||
getToggle(id, setState, 'show-quality-monitor', 'Show quality monitor'),
|
getToggle(id, setState, 'show-quality-monitor', 'Show quality monitor'),
|
||||||
];
|
];
|
||||||
if (!gFFI.canvasModel.cursorEmbedded) {
|
if (!gFFI.canvasModel.cursorEmbedded && !pi.is_wayland) {
|
||||||
toggles.insert(0,
|
toggles.insert(0,
|
||||||
getToggle(id, setState, 'show-remote-cursor', 'Show remote cursor'));
|
getToggle(id, setState, 'show-remote-cursor', 'Show remote cursor'));
|
||||||
}
|
}
|
||||||
|
@ -452,6 +452,11 @@ class FfiModel with ChangeNotifier {
|
|||||||
setViewOnly(peerId,
|
setViewOnly(peerId,
|
||||||
bind.sessionGetToggleOptionSync(id: peerId, arg: 'view-only'));
|
bind.sessionGetToggleOptionSync(id: peerId, arg: 'view-only'));
|
||||||
}
|
}
|
||||||
|
if (connType == ConnType.defaultConn) {
|
||||||
|
try {
|
||||||
|
_pi.platform_additions = json.decode(evt['platform_additions']);
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1687,6 +1692,9 @@ class PeerInfo {
|
|||||||
List<Display> displays = [];
|
List<Display> displays = [];
|
||||||
Features features = Features();
|
Features features = Features();
|
||||||
List<Resolution> resolutions = [];
|
List<Resolution> resolutions = [];
|
||||||
|
Map<String, dynamic> platform_additions = {};
|
||||||
|
|
||||||
|
bool get is_wayland => platform_additions['is_wayland'] == true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const canvasKey = 'canvas';
|
const canvasKey = 'canvas';
|
||||||
|
@ -91,6 +91,8 @@ message PeerInfo {
|
|||||||
Features features = 9;
|
Features features = 9;
|
||||||
SupportedEncoding encoding = 10;
|
SupportedEncoding encoding = 10;
|
||||||
SupportedResolutions resolutions = 11;
|
SupportedResolutions resolutions = 11;
|
||||||
|
// Use JSON's key-value format which is friendly for peer to handle.
|
||||||
|
string platform_additions = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
message LoginResponse {
|
message LoginResponse {
|
||||||
|
@ -509,6 +509,7 @@ impl InvokeUiSession for FlutterHandler {
|
|||||||
("features", &features),
|
("features", &features),
|
||||||
("current_display", &pi.current_display.to_string()),
|
("current_display", &pi.current_display.to_string()),
|
||||||
("resolutions", &resolutions),
|
("resolutions", &resolutions),
|
||||||
|
("platform_additions": &pi.platform_additions),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -843,6 +843,16 @@ impl Connection {
|
|||||||
pi.hostname = DEVICE_NAME.lock().unwrap().clone();
|
pi.hostname = DEVICE_NAME.lock().unwrap().clone();
|
||||||
pi.platform = "Android".into();
|
pi.platform = "Android".into();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
{
|
||||||
|
pi.platform_additions = format!(r#"
|
||||||
|
{{
|
||||||
|
"is_wayland": {},
|
||||||
|
}}
|
||||||
|
"#, crate::platform::current_is_wayland());
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "hwcodec")]
|
#[cfg(feature = "hwcodec")]
|
||||||
{
|
{
|
||||||
let (h264, h265) = scrap::codec::Encoder::supported_encoding();
|
let (h264, h265) = scrap::codec::Encoder::supported_encoding();
|
||||||
|
Loading…
Reference in New Issue
Block a user