Files
迢辰andXuc Pan 306489d8ad fix(capture): choose a cursor mode the portal advertises (#25)
* fix(capture): choose a cursor mode the portal advertises

`uur run` on a Wayland session aborted during capture negotiation:

    Error: Portal request didn't succeed: Other
    Error: ZBus Error: org.freedesktop.portal.Error.InvalidArgument:
           Unavailable cursor mode 2

`negotiate` hardcoded `CursorMode::Embedded` (2). The portal frontend
validates that against the backend's `AvailableCursorModes` and rejects
anything outside it, so any backend that does not offer Embedded could
never start a session. A frontend whose backend property cache is empty
reports `AvailableCursorModes = 0` and then rejects every mode, which is
what made this fail even on backends that do support Embedded: restarting
`xdg-desktop-portal` restored the flags from 0 to 7 and mode 2 was
accepted again.

`preferred_cursor_mode` now reads the advertised flags and picks Embedded,
then Hidden, then Metadata. If none are advertised it fails with an
actionable message naming the portal restart, instead of surfacing a raw
D-Bus error. Older portals that do not implement the v2 property keep the
previous behaviour.

The same hardcoded mode in the RemoteDesktop input path is routed through
the shared helper.

Adds four tests: preference order, subset fallback, the empty-advertisement
regression, and source-type mapping.

* fix(capture): preserve portal errors and report cursor fallback

---------

Co-authored-by: Xuc Pan <[email protected]>
2026-10-15 14:44:04 +08:00

137 lines
8.7 KiB
YAML

doctor:
header: "uur environment report"
install_hint: "not installed — install wine/pipewire per your distro"
no_portal_backend: "no xdg-desktop-portal backend found (Wayland capture/input unavailable)"
present: "present"
backend_x11: "X11 session: XTEST injection"
backend_wayland: "Wayland session: kernel uinput injection"
backend_portal: "Wayland session: standard RemoteDesktop portal"
backend_none: "no graphical session detected"
backend_partial: "XWayland windows only; native Wayland desktop input requires portal or uinput"
backend_wayland_missing: "full desktop input unavailable; check RemoteDesktop authorization or /dev/uinput access"
client_incomplete: "client or server executable missing; run uur setup --repair"
service_registered: "registered; successful startup is checked by uur run"
service_missing: "missing service registration; run uur setup --repair"
webview_pending: "not installed; uur run will invoke the bundled WebView2 installer"
portal_capture_advertised: "source types advertised; authorization and real frames are checked by uur run"
portal_input_advertised: "keyboard and pointer advertised; session authorization is checked by uur run"
uinput_module: "device present but kernel module not loaded (install the packaged udev rule + modules-load entry, then reboot)"
uinput_permission: "not writable by this user (needs the uur udev uaccess rule or the input group)"
uinput_missing: "/dev/uinput missing from this kernel"
portal_capture_missing: "ScreenCast interface unavailable in the active portal backend"
portal_input_missing: "RemoteDesktop interface unavailable; uinput can provide the fallback"
terminal_missing: "Win64 terminal proxy missing; reinstall uur"
launcher_missing: "Win64 Quick Launch proxy missing; reinstall uur"
xdg_launcher_missing: "install GLib's gio or gtk-launch"
wallpaper_missing: "not detected; set UUR_WALLPAPER to an image path"
footer: "This report checks installation files and advertised capabilities. uur run verifies the input session, Wayland frames, and Windows service startup. Use uur setup --repair to retry Wine initialization after an interrupted installation."
input:
portal_unavailable: "Wayland portal input is not available in this session"
no_display: "no graphical session detected (DISPLAY and WAYLAND_DISPLAY are unset)"
uinput_unavailable: "kernel uinput injection unavailable"
wayland_no_full_input: "Wayland desktop input requires a working RemoteDesktop portal or writable /dev/uinput. Check the packaged udev rule and uinput module. Explicit xtest is limited to XWayland windows."
bridge:
listening: "input bridge listening on 127.0.0.1:%{port}"
session_summary: "%{count} input records injected"
connected: "hook connected; injecting via %{backend}"
disconnected_clean: "hook disconnected; held keys released"
disconnected_error: "hook error: %{error}"
bad_token_fingerprint: "connection rejected: bridge token mismatch (received prefix %{prefix}…)"
bad_token: "connection rejected: bridge token mismatch"
stop_requested: "stop requested"
upstream:
unreachable: "cannot reach NetEase's official release feed"
unparsable: "cannot parse the release feed response: %{url}"
latest: "latest official release: %{version} (%{filename})"
up_to_date: "the provisioned client is up to date"
newer_available: "installed %{local}; upstream now has %{upstream}"
not_provisioned: "no provisioned client found; run `uur setup`"
capture:
direct_enabled: "Direct Wayland monitor capture explicitly enabled; it uses uinput and does not show a portal consent dialog. Use uur display backend portal to restore portal capture."
portal_enabled: "Portal-consented capture enabled"
direct_started: "direct Wayland monitor capture started"
session_ready: "portal session ready (video node %{node}); streaming to the private runtime transport"
helper_failed: "the capture helper exited with an error"
cursor_unsupported: "the desktop portal advertises no usable cursor mode, so screen capture cannot start. Restart the portal (systemctl --user restart xdg-desktop-portal) and retry; if it persists, check that a ScreenCast backend matching your session is installed."
cursor_not_embedded: "the portal cannot embed the cursor; capture will continue without a cursor in the video frames"
session:
already_running: "a session is already running - use it, or run `uur stop` first"
server_running: "GameViewerServer is running"
launching_client: "starting the managed client (capture and bridge are live)"
client_exited: "client exited (code %{code}); session ended"
capture_error: "capture unavailable: %{error}"
webview_missing: "WebView2 bootstrapper missing from the client directory; the management UI cannot start"
webview_failed: "WebView2 installation failed"
quick_launch_ready: "%{count} Linux applications exported to UU Quick Launch"
audio_backend: "Wine audio backend: %{backend}"
wine_dpi: "Wine system DPI set from Xft.dpi: %{dpi}"
waiting_capture: "waiting for the first Wayland capture frame; select a monitor in the portal dialog"
waiting_direct_capture: "waiting for the first direct Wayland monitor frame"
capture_not_ready: "No Wayland frames arrived within 120 seconds. Check the ScreenCast portal and PipeWire; select an actual monitor rather than an unassigned dynamic cast target. See the session log."
service_failed: "GameViewerService did not start. Run uur setup --repair and inspect ~/.local/state/uur/session.log and ~/.local/share/uur/hook.log."
setup:
eula_prompt: "The official UU Remote client will be downloaded from NetEase and is governed by their EULA: %{url}\nRe-run with --accept-eula to continue."
eula_required: "EULA acceptance is required before provisioning"
eula_recorded: "EULA acceptance recorded"
already_provisioned: "client already provisioned"
downloading: "downloading the official installer from %{url}"
download_failed: "the official installer download failed"
initializing_prefix: "initializing the managed Wine prefix"
prefix_failed: "Wine prefix initialization failed (%{status}); run uur setup --repair after resolving the Wine error"
repaired: "Wine prefix updated and client installation verified at %{path}"
install_failed: "The official installer failed or was cancelled (%{status}); installation is incomplete. Retry with uur setup --repair."
client_incomplete: "The installer did not provide both GameViewer.exe and GameViewerServer.exe; retry with uur setup --repair"
service_incomplete: "GameViewerService has no valid registered executable; run uur setup --repair"
installing_client: "installing the official client (silent mode)"
silent_install_unavailable: "the installer ignored silent mode; complete its window manually if it opened"
done: "provisioned into %{path}"
tray:
title: "UU Remote"
tooltip: "UU Remote for Linux"
open: "Open UU Remote"
quit: "Quit"
registered: "native desktop tray registered"
uninstall:
no_root: "Run uur uninstall as the desktop user, without sudo. Remove the system package separately with its package manager."
plan: "Removal plan (directories include their contents):"
purge_warning: "This permanently deletes the managed client, login/account data, Wine environment, installer cache, configuration and logs."
keep_data: "Client/account data, configuration and logs will be kept. Use --purge to remove them too."
package_hint: "System package files and shared dependencies are left to the package manager. On Arch, run sudo pacman -Rns uur after this command."
dry_run: "Preview only; no processes were stopped and no files were changed."
confirm_required: "No terminal is available for confirmation. Review --dry-run, then pass --yes to confirm removal."
confirm: "Proceed with removal? [y/N]"
cancelled: "Cancelled; no files were changed."
done: "The selected user files and recognized source-installation files have been removed."
autostart:
enabled: "login autostart enabled: %{path}"
disabled: "login autostart disabled"
status_enabled: "login autostart is enabled: %{path}"
status_disabled: "login autostart is disabled"
wol:
interface: "interface: %{interface}"
mac: "MAC address: %{mac}"
magic_support: "Magic Packet support: %{state}"
magic_enabled: "Magic Packet enabled: %{state}"
connection: "NetworkManager connection: %{connection}"
yes: "yes"
no: "no"
unknown_ethtool: "unknown (install ethtool)"
unsupported: "%{interface} does not advertise Magic Packet wake support"
verify_failed: "Wake-on-LAN state could not be verified on %{interface}"
enabled: "Magic Packet wake enabled on %{interface}"
disabled: "Magic Packet wake disabled on %{interface}"
display:
status: "Wayland capture source: %{source}"
changed: "Wayland capture source changed to %{source}; the portal will ask for a new selection on the next run"