mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-27 15:11:01 +03:00
refact: reduce try_get_displays() on login (#9333)
* refact: reduce try_get_displays() on login Signed-off-by: fufesou <linlong1266@gmail.com> * Function rename Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -344,14 +344,18 @@ pub fn is_inited_msg() -> Option<Message> {
|
||||
None
|
||||
}
|
||||
|
||||
pub async fn update_get_sync_displays() -> ResultType<Vec<DisplayInfo>> {
|
||||
pub async fn update_get_sync_displays_on_login() -> ResultType<Vec<DisplayInfo>> {
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
if !is_x11() {
|
||||
return super::wayland::get_displays().await;
|
||||
}
|
||||
}
|
||||
check_update_displays(&try_get_displays()?);
|
||||
#[cfg(not(windows))]
|
||||
let displays = display_service::try_get_displays();
|
||||
#[cfg(windows)]
|
||||
let displays = display_service::try_get_displays_add_amyuni_headless();
|
||||
check_update_displays(&displays?);
|
||||
Ok(SYNC_DISPLAYS.lock().unwrap().displays.clone())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user