mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -339,7 +339,9 @@ pub fn session_set_reverse_mouse_wheel(session_id: SessionID, value: String) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_displays_as_individual_windows(session_id: SessionID) -> SyncReturn<Option<String>> {
|
||||
pub fn session_get_displays_as_individual_windows(
|
||||
session_id: SessionID,
|
||||
) -> SyncReturn<Option<String>> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
SyncReturn(Some(session.get_displays_as_individual_windows()))
|
||||
} else {
|
||||
@@ -353,6 +355,22 @@ pub fn session_set_displays_as_individual_windows(session_id: SessionID, value:
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_use_all_my_monitors_when_connecting(
|
||||
session_id: SessionID,
|
||||
) -> SyncReturn<Option<String>> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
SyncReturn(Some(session.get_use_all_my_monitors_when_connecting()))
|
||||
} else {
|
||||
SyncReturn(None)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_set_use_all_my_monitors_when_connecting(session_id: SessionID, value: String) {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
session.save_use_all_my_monitors_when_connecting(value);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn session_get_custom_image_quality(session_id: SessionID) -> Option<Vec<i32>> {
|
||||
if let Some(session) = sessions::get_session_by_session_id(&session_id) {
|
||||
Some(session.get_custom_image_quality())
|
||||
@@ -1069,6 +1087,29 @@ pub fn main_get_main_display() -> SyncReturn<String> {
|
||||
SyncReturn(display_info)
|
||||
}
|
||||
|
||||
pub fn main_get_displays() -> SyncReturn<String> {
|
||||
#[cfg(target_os = "ios")]
|
||||
let display_info = "".to_owned();
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
let mut display_info = "".to_owned();
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
if let Ok(displays) = crate::display_service::try_get_displays() {
|
||||
let displays = displays
|
||||
.iter()
|
||||
.map(|d| {
|
||||
HashMap::from([
|
||||
("x", d.origin().0),
|
||||
("y", d.origin().1),
|
||||
("w", d.width() as i32),
|
||||
("h", d.height() as i32),
|
||||
])
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
display_info = serde_json::to_string(&displays).unwrap_or_default();
|
||||
}
|
||||
SyncReturn(display_info)
|
||||
}
|
||||
|
||||
pub fn session_add_port_forward(
|
||||
session_id: SessionID,
|
||||
local_port: i32,
|
||||
|
||||
Reference in New Issue
Block a user