mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Merge pull request #6343 from 21pages/remove_manual_fps
Remove manual adjustment of fps, automatically adjusted to the maximum already
This commit is contained in:
@@ -1483,10 +1483,6 @@ impl LoginConfigHandler {
|
||||
config.custom_image_quality[0]
|
||||
};
|
||||
msg.custom_image_quality = quality << 8;
|
||||
#[cfg(feature = "flutter")]
|
||||
if let Some(custom_fps) = self.options.get("custom-fps") {
|
||||
msg.custom_fps = custom_fps.parse().unwrap_or(30);
|
||||
}
|
||||
n += 1;
|
||||
}
|
||||
let view_only = self.get_toggle_option("view-only");
|
||||
@@ -1667,27 +1663,6 @@ impl LoginConfigHandler {
|
||||
res
|
||||
}
|
||||
|
||||
/// Create a [`Message`] for saving custom fps.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `fps` - The given fps.
|
||||
pub fn set_custom_fps(&mut self, fps: i32) -> Message {
|
||||
let mut misc = Misc::new();
|
||||
misc.set_option(OptionMessage {
|
||||
custom_fps: fps,
|
||||
..Default::default()
|
||||
});
|
||||
let mut msg_out = Message::new();
|
||||
msg_out.set_misc(misc);
|
||||
let mut config = self.load_config();
|
||||
config
|
||||
.options
|
||||
.insert("custom-fps".to_owned(), fps.to_string());
|
||||
self.save_config(config);
|
||||
msg_out
|
||||
}
|
||||
|
||||
pub fn get_option(&self, k: &str) -> String {
|
||||
if let Some(v) = self.config.options.get(k) {
|
||||
v.clone()
|
||||
@@ -1795,7 +1770,11 @@ impl LoginConfigHandler {
|
||||
crate::flutter::push_global_event(crate::flutter::APP_TYPE_MAIN, evt);
|
||||
}
|
||||
if config.keyboard_mode.is_empty() {
|
||||
if is_keyboard_mode_supported(&KeyboardMode::Map, get_version_number(&pi.version), &pi.platform) {
|
||||
if is_keyboard_mode_supported(
|
||||
&KeyboardMode::Map,
|
||||
get_version_number(&pi.version),
|
||||
&pi.platform,
|
||||
) {
|
||||
config.keyboard_mode = KeyboardMode::Map.to_string();
|
||||
} else {
|
||||
config.keyboard_mode = KeyboardMode::Legacy.to_string();
|
||||
|
||||
@@ -395,7 +395,7 @@ pub fn session_is_keyboard_mode_supported(session_id: SessionID, mode: String) -
|
||||
SyncReturn(is_keyboard_mode_supported(
|
||||
&mode,
|
||||
session.get_peer_version(),
|
||||
&session.peer_platform()
|
||||
&session.peer_platform(),
|
||||
))
|
||||
} else {
|
||||
SyncReturn(false)
|
||||
@@ -411,12 +411,6 @@ pub fn session_set_custom_image_quality(session_id: SessionID, value: i32) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_set_custom_fps(session_id: SessionID, fps: i32) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.set_custom_fps(fps);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_lock_screen(session_id: SessionID) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.lock_screen();
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
use crate::{input::{MOUSE_BUTTON_LEFT, MOUSE_TYPE_DOWN, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL}, common::{is_keyboard_mode_supported, get_supported_keyboard_modes}};
|
||||
use crate::{
|
||||
common::{get_supported_keyboard_modes, is_keyboard_mode_supported},
|
||||
input::{MOUSE_BUTTON_LEFT, MOUSE_TYPE_DOWN, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL},
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use rdev::{Event, EventType::*, KeyCode};
|
||||
@@ -213,7 +216,7 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
self.lc.read().unwrap().version.clone()
|
||||
}
|
||||
|
||||
pub fn fallback_keyboard_mode(&self) -> String {
|
||||
pub fn fallback_keyboard_mode(&self) -> String {
|
||||
let peer_version = self.get_peer_version();
|
||||
let platform = self.peer_platform();
|
||||
|
||||
@@ -392,11 +395,6 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_custom_fps(&self, custom_fps: i32) {
|
||||
let msg = self.lc.write().unwrap().set_custom_fps(custom_fps);
|
||||
self.send(Data::Message(msg));
|
||||
}
|
||||
|
||||
pub fn get_remember(&self) -> bool {
|
||||
self.lc.read().unwrap().remember
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user