mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 14:59:02 +08:00
wayland not call check_get_displays_changed_msg (#8637)
* wayland not call check_get_displays_changed_msg For wayland, call Display::all() in video service will cause block, I don't know the reason. Signed-off-by: 21pages <sunboeasy@gmail.com> * Update display_service.rs --------- Signed-off-by: 21pages <sunboeasy@gmail.com> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
parent
0bb4d43e9e
commit
f07936a911
@ -59,6 +59,7 @@ impl Display {
|
||||
})
|
||||
}
|
||||
|
||||
// Call this function carefully for wayland, it may cause blocking
|
||||
pub fn all() -> io::Result<Vec<Display>> {
|
||||
Ok(if super::is_x11() {
|
||||
x11::Display::all()?
|
||||
|
@ -184,6 +184,14 @@ fn check_get_displays_changed_msg() -> Option<Message> {
|
||||
}
|
||||
|
||||
pub fn check_displays_changed() -> ResultType<()> {
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
// For wayland, call Display::all() in video service will cause block, reproduced by refresh, I don't know the reason.
|
||||
// block, or even crash here, https://github.com/rustdesk/rustdesk/blob/0bb4d43e9ea9d9dfb9c46c8d27d1a97cd0ad6bea/libs/scrap/src/wayland/pipewire.rs#L235
|
||||
if !is_x11() {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
check_update_displays(&try_get_displays()?);
|
||||
Ok(())
|
||||
}
|
||||
@ -394,7 +402,8 @@ pub fn try_get_displays_(add_amyuni_headless: bool) -> ResultType<Vec<Display>>
|
||||
let mut displays = Display::all()?;
|
||||
|
||||
// Do not add virtual display if the platform is not installed or the virtual display is not supported.
|
||||
if !crate::platform::is_installed() || !virtual_display_manager::is_virtual_display_supported() {
|
||||
if !crate::platform::is_installed() || !virtual_display_manager::is_virtual_display_supported()
|
||||
{
|
||||
return Ok(displays);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user