The iOS viewer sends PrivateScreenSettingRequest{enable=0, privacy_type=3}
when the user turns the display off: its enable bit is the picture-mode
switch and the explicit type carries the intent. The host treated enable=0
as off, so the screen was restored instead of turned off.
Normalize that combination for iOS controllers only. Android 4.43.0 was
verified with the field-1 semantics, so keep Android and desktop viewers
unchanged. Record the platform after a desktop session is created, update
it on capture_desktop promotion, and cancel a pending UU_PRIVACY_AUTO even
when the switch is refused.
* perf(portal): wait for frames without polling
* fix(portal): use monotonic clock for condition variable wait deadline
* fix(portal): compute wait_for_first_frame deadline with monotonic clock
* annotation: answer viewer draw RPCs and draw strokes on an X11 overlay
The official viewer's watch-mode annotation (批注) sends RpcRequest 27
draw_req, which this host never answered, so the viewer reported
批注开启失败 (9998). The schema is taken from the Mac 4.42.0
UURemoteService SwiftProtobuf metadata. Replies go on TEXT because a
reply on CONTROL times out.
Strokes are drawn on a click-through override-redirect ARGB window,
which needs a compositing manager. The window exists only while
annotation is on and is removed when the desktop session ends.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* annotation: follow root resizes and scope resets to the owning peer
Addresses the Codex review on #174.
- A RandR resize (on X11 the viewer's resolution choice does this) left
the overlay at its old size. The overlay now watches root
ConfigureNotify and is rebuilt at the new geometry. Strokes keep the
viewer's points and are laid out again.
- A delayed reset from a replaced desktop peer could remove the
annotation of the viewer that took over. Requests and resets now carry
the peer (its PeerActions address), and only the owner's reset,
toggle-off or clear applies.
The ignored overlay smoke test covers both cases. It always checks the
owner takeover, and checks the resize when UU_ANNOTATION_SMOKE_RESIZE is
set on a disposable display.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
* fix(privacy): match recorded input devices after a reboot
The recovery record stores KWin's `eventN` sysNames, but udev renumbers
them between boots. A record replayed after a reboot (privacy was on at
shutdown) then set `enabled` on a device path that no longer exists; the
restore failed, kept the record, and every later switch failed at the
same step. The device that had been blocked could also stay disabled.
Records now keep name/product/vendor next to the sysName, and a restore
matches the current device by that identity, falling back to the exact
sysName for older string-only records. A device that no longer exists is
skipped with a log line instead of failing the restore, so the record,
the guard and the outputs are cleaned up; a device that exists but cannot
be enabled still fails and keeps the record for the next attempt.
Verified by replaying records with the release build on KDE Plasma 6.8: a
stale `event14` for a mouse now on `event12` is re-enabled and the record
removed; a record for a missing device logs the skip and restores
normally. `cargo test --features wayland,portal`: 330 passed, 10 ignored.
* fix(privacy): restore every device sharing an identity
- enable every current device whose identity matches a record entry,
deduplicated by sysName: two record entries can describe one device, and
one identity can cover several (identical keyboards, or a receiver
exposing several event nodes under the same name)
- a failed property read during restore is an error instead of a missing
device, so the record and the guard stay for the next attempt; blocking
keeps the lenient read
- the gone-device warning logs a count only, matching the log-privacy rule
* fix(privacy): re-enable readable devices before reporting incomplete enumeration
A failed property read during restore no longer aborts enumeration before
set_sys runs: the readable matching devices are re-enabled first, then the
incomplete read is returned as an error so the record and the guard stay
for another attempt. Blocking still skips unreadable devices.
* input: park the pointer worker until pointer or gesture work exists
A fixed 4 ms tick kept ~250 wakeups/s (clock_gettime storms, worker
steal spins, pow-heavy flush math) burning ~3% CPU on an idle host with
no viewer connected. The worker now parks on a Notify permit until a
pointer/scroll/button event or a live touch gesture needs the 4 ms
cadence; notify_one permit semantics make the park check race-free.
Sub-notch scroll residue cannot inject alone, so it parks too.
* fix(input): preserve pointer wake ordering and motion cadence
Hold the serial lock before notifying button transitions so a parked worker cannot miss a newly pending gesture. Keep the 4 ms coalescing cadence until an empty tick and reset the interval after each parked phase.
Add regression coverage for button wake ordering, 1 ms motion streams, and idle cadence reset using Tokio test-only clock control.
---------
Co-authored-by: ferstar <[email protected]>
* fix(privacy): keep the cover window out of the task manager
The cover is a plain Wayland toplevel and GTK's skip-taskbar hint is X11
only, so KWin listed it: the task manager showed an unidentified window
(class uuremote-server, caption "uu-remote-linux privacy") with the icon
theme's generic "wayland" icon, a yellow W in Papirus.
Mark the window through KWin scripting after the cover reports ready. The
same one-shot script mechanism already moves windows to the virtual output.
Failure only logs; the cover itself is unaffected.
Verified on KDE Plasma 6.8 Wayland: setting skipTaskbar on the running
cover removes the task manager entry immediately, and the entry returns
when a new cover window is created without the fix. `cargo test --features
wayland,portal`: 320 passed, 10 ignored.
* fix(privacy): match every cover window, not just the first caption
Picture mode creates one cover per physical monitor with the same title,
and KWin appends " <2>" and similar suffixes to duplicate captions, so the
exact match skipped every cover after the first on a multi-monitor host.
Match the title as a prefix instead.
* fix(privacy): report the cover ready only after its windows are mapped
The child wrote "ready" before gtk_main(), so the host marked skip-taskbar
while KWin may not have listed the cover yet; a cover that mapped later
kept the task manager entry. Pump the pending GTK events to map the windows
before the handshake, and run the mark script a second time to catch a
compositor-side delay.
* 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.
The WebSocket transport already reduces errors to a category or HTTP status
without the token or endpoint, so log it instead of 'details omitted' to tell
a refused upgrade from a network failure (#166).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A CF_UNICODETEXT name made the Windows viewer register a custom
clipboard format instead of using id 13, so Linux text never reached
the standard Unicode format. Fixes#151.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(audio): capture and encode Opus in process
* feat(portal): encode VAAPI from leased DMA-BUF frames
* fix(input): route Portal controls and committed ASCII through uinput
* docs(portal): shorten setup notes and colocate hardware acceptance guidance
* fix(input): preserve GNOME IME guard for committed uinput text
* build: link pulse/opus after the static C archive (--as-needed)
GNU ld with --as-needed (Ubuntu default) drops shared libraries listed before
libx11_engine.a, so --features inproc-av failed to link with undefined gbm_*,
xcb_dri3_* and xcb_damage_* on Ubuntu (found on aarch64; Arch is unaffected).
Co-authored-by: ferstar <[email protected]>
SDL viewer forwards one mapped controller (gpd_connect/gpd_update/gpd_disconnect) and receives two-motor gpd_vibration over the existing CONTROL channel. Default off (UU_VIEWER_NATIVE_GAMEPAD=1).
Replayed as touch, a phone drag scrolled in browsers but still selected
text in VTE terminals (Ptyxis, GNOME Terminal), as on a real touchscreen.
By default on the portal backend the host now decides per press: moving
past 12 px within 450 ms scrolls smoothly (NotifyPointerAxis or EIS
scroll, content follows the finger, `finish` on release so clients may
coast), holding still selects with button 1 down, and a short press
clicks. This works in terminals too and needs no touchscreen consent.
UU_TOUCH_INPUT=touch keeps the touchscreen replay (with its one-time
consent upgrade); UU_TOUCH_INPUT=0 keeps plain mouse drags.
* portal: mobile touch-mode drags become touch, consent asks once for it
In touch mode the Android viewer sends a finger as a left-button drag at
absolute positions (observed: press, mouse_move_absolute stream, release),
which on GNOME selects text instead of scrolling. SelectDevices now also
asks for the touchscreen type where AvailableDeviceTypes offers it, and a
drag from an Android/iOS controller (controller_platform 2/3) that follows
absolute motion is replayed as one finger through NotifyTouch* or EIS
touch, so the desktop scrolls and taps as on a touch screen. Relative
motion (the trackpad mode) and every other viewer keep mouse buttons.
A consent saved before this restores keyboard and pointer only. The first
mobile drag then asks the host once per run in the background (GNOME's
share dialog, also visible on the phone; the consent timeout closes it)
and swaps the new session in only when it grants the touchscreen for the
same monitor and size. The saved consent is never removed beforehand.
UU_TOUCH_INPUT=0 keeps mouse drags and never asks.
* input: type mobile IME text as portal keysyms on Latin GNOME layouts
Each mobile text_input was set as the clipboard and pasted with
Shift+Insert, which VTE terminals bind to the PRIMARY selection: text
typed from the phone into a terminal pasted whatever was last selected
(observed: a selected line of box-drawing characters for every letter).
When GNOME's active input source (first of mru-sources) is a Latin xkb
layout, printable ASCII, newline and tab now go through
NotifyKeyboardKeysym, where Mutter picks the key and Shift level of the
active layout. Other text, IBus engines, KDE and EIS sessions keep the
clipboard paste, which no longer replaces the clipboard for plain typing.
* portal test: accept libei before 1.3 rejecting a touch outside one of two regions
libei 1.2 (Ubuntu 24.04, CI) accepts a touch only inside every region of the
device; 1.3.0 checks any region. The harness device also carries a region for
another screen, so the older library rejects the touch with a client-bug
diagnostic. A real one-stream session has one region.