client side view mode

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-03-16 09:37:35 +08:00
parent 51bb83cd8c
commit 0e05df12fc
43 changed files with 203 additions and 46 deletions

View File

@@ -1296,7 +1296,12 @@ impl LoginConfigHandler {
if let Some(custom_fps) = self.options.get("custom-fps") {
msg.custom_fps = custom_fps.parse().unwrap_or(30);
}
if self.get_toggle_option("show-remote-cursor") {
let view_only = self.get_toggle_option("view-only");
if view_only {
msg.disable_keyboard = BoolOption::Yes.into();
n += 1;
}
if view_only || self.get_toggle_option("show-remote-cursor") {
msg.show_remote_cursor = BoolOption::Yes.into();
n += 1;
}
@@ -1312,7 +1317,7 @@ impl LoginConfigHandler {
msg.enable_file_transfer = BoolOption::Yes.into();
n += 1;
}
if self.get_toggle_option("disable-clipboard") {
if view_only || self.get_toggle_option("disable-clipboard") {
msg.disable_clipboard = BoolOption::Yes.into();
n += 1;
}