From beeeef14f0a61bd622aacf042b4396bdeaed9b61 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 3 Nov 2026 08:26:06 +0800 Subject: [PATCH] fix(wayland): pass on an unclassified capture error instead of "x11 expected" Every portal handshake failure is tagged and gets its own message, so the untagged errors that still reach this fallback at login are internal ones (GStreamer init, a poisoned lock). Reporting them as "x11 expected" sent users off to switch to X11 for faults X11 does not fix, and hid the real error. Send the error itself, as the Ubuntu 21+ branch already does. No regression test: CI runs on Ubuntu 24.04, where map_err_scrap takes the Ubuntu branch and returns the raw error both before and after this change. Refs #16829 Co-Authored-By: Claude Opus 5.5 --- src/server/wayland.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/wayland.rs b/src/server/wayland.rs index d37e242df..c9bbad94c 100644 --- a/src/server/wayland.rs +++ b/src/server/wayland.rs @@ -12,7 +12,7 @@ use std::io; use crate::{ client::{ SCRAP_OTHER_VERSION_OR_X11_REQUIRED, SCRAP_UBUNTU_HIGHER_REQUIRED, - SCRAP_X11_REQUIRED, SCRAP_XDP_PORTAL_UNAVAILABLE, + SCRAP_XDP_PORTAL_UNAVAILABLE, }, platform::linux::is_x11, }; @@ -82,7 +82,9 @@ fn map_err_scrap(err: String) -> io::Error { } else if err_lower.contains("pipewire") { io::Error::new(io::ErrorKind::Other, SCRAP_OTHER_VERSION_OR_X11_REQUIRED) } else { - io::Error::new(io::ErrorKind::Other, SCRAP_X11_REQUIRED) + // Unclassified, so say what failed: "x11 expected" sent users off to switch to X11 + // for faults X11 does not fix (#16829). + io::Error::new(io::ErrorKind::Other, err) } } }