fix wayland Display::all() comment (#8664)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages 2024-07-09 22:10:39 +08:00 committed by GitHub
parent f07936a911
commit e2d217a138
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ impl Display {
})
}
// Call this function carefully for wayland, it may cause blocking
// Currently, wayland need to call wayland::clear() before call Display::all()
pub fn all() -> io::Result<Vec<Display>> {
Ok(if super::is_x11() {
x11::Display::all()?

View File

@ -186,7 +186,7 @@ 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.
// Currently, wayland need to call wayland::clear() before call Display::all(), otherwise it will cause
// block, or even crash here, https://github.com/rustdesk/rustdesk/blob/0bb4d43e9ea9d9dfb9c46c8d27d1a97cd0ad6bea/libs/scrap/src/wayland/pipewire.rs#L235
if !is_x11() {
return Ok(());