mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 08:50:40 +01:00
* feat(privacy): auto-enable the privacy screen on desktop connect `UU_PRIVACY_AUTO=picture` / `screen-off` (or 2 / 3) enables the privacy screen when the first desktop controller connects. Off by default. The switch waits for the portal capture session and retries while it is missing; the viewer's own RPC 7 cancels a pending auto-enable for that session. The privacy state poller that pushes SystemMetrics and SystemStateChange now starts for desktop peers too (it only ran for a tool peer promoted to desktop), and it pushes once on its first tick. A mode the viewer did not request, such as an auto-enable, therefore reaches its menu, and the state message also goes to TEXT, which viewers read for privacy replies. Verified on KDE Plasma Wayland with an iOS viewer: auto picture and auto screen-off both engage, the menu reflects the mode after the push, and a disconnect restores the physical outputs. `cargo test --features wayland,portal`: 320 passed, 10 ignored. * fix(privacy): let a viewer request win against auto-enable races Two paths could still override an explicit choice: - the override was checked before acquiring STATE, so an RPC 7 applied in that window could disable privacy and the auto thread could turn it back on; the check now happens inside the same lock that enters the mode - `session_started` captured the override counter as its baseline, so a request that arrived after CONTROL opened but before the session counter started was treated as unrelated and auto-enable ran anyway; the counter is now a flag set by any RPC 7 and cleared only when the last desktop session ends docs/privacy-screen.md now says remote-assistance (guest) sessions are covered too, and that supported hosts push the current privacy state once on every desktop connect.