mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-08-27 04:37:35 +00:00
refactor: move the socket probe to its own file behind a feature
Addresses the maintainer's two requests on #580: linux.rs was crowded, and the new fallback should not touch the base Wayland path. All the socket-probe machinery moves to src/platform/linux/wayland_probe.rs - the child entry point, the runtime-dir scan, the privilege drop, the process-group probe and its buffered-line inspection - leaving WaylandDisplayInfo and get_wayland_displays in linux.rs. The module and the fallback call in get_wayland_displays are gated on a new off-by-default feature 'wayland_probe'; without it get_wayland_displays returns the connect error exactly as it did before this fallback existed, so a consumer that does not build the DRM login-screen backend compiles none of this. The DRM build turns the feature on through scrap/drm.
This commit is contained in:
@@ -9,6 +9,9 @@ edition = "2018"
|
||||
[features]
|
||||
default = []
|
||||
webrtc = ["dep:webrtc"]
|
||||
# The isolated Wayland socket-probe fallback (src/platform/linux/wayland_probe.rs). Off by default
|
||||
# so the base Wayland enumeration is untouched; the DRM login-screen build (scrap/drm) turns it on.
|
||||
wayland_probe = []
|
||||
|
||||
[dependencies]
|
||||
# new flexi_logger failed on rustc 1.75
|
||||
|
||||
Reference in New Issue
Block a user