moxuunandXuc Pan e7724c6d86 fix(hook): map a full-monitor capture request onto the whole frame (#30)
* fix(hook): map a full-monitor capture request onto the whole frame

The Wine hook scaled the client's source rectangle by the virtual desktop
size, on the assumption that a captured frame covers every monitor. The
Wayland portal capture path selects a single monitor, so on a multi-monitor
desktop the frame is narrower than the virtual desktop and the horizontal
scale factor was wrong.

With a 4480x1600 virtual desktop and a 2560x1600 frame, a request for the
whole 2560x1600 monitor produced:

    sw = 2560 * 2560 / 4480 = 1462

That sampled only the left 57% of the frame and stretched it across the
destination, dropping the right 43%. The vertical factor stayed correct
(1600 * 1600 / 1600), which is why the symptom was a missing right edge
rather than a visible aspect distortion. On a single monitor the virtual
desktop equals the frame and the two factors agree, so the bug stayed
hidden.

Detect the case where the requested rectangle covers exactly one Wine
monitor whose size equals the frame, and use the whole frame. Every other
request keeps the previous virtual-desktop mapping, so partial regions are
unchanged.

This does not add portal coordinates to the frame protocol. Portal
coordinates are compositor coordinates and Wine enumerates monitors in a
different order, so capturing a monitor that is not the Wine primary
monitor still needs a separate output-to-monitor mapping.

* fix(hook): keep full-monitor geometry across fractional scaling

GNOME 125 percent scaling can expose a 2048x1152 Wine monitor while the selected Portal frame remains 1280x720. Match the aspect ratio of an exact monitor rectangle instead of requiring equal pixel dimensions; leave partial and virtual-desktop requests on the existing path.

Verified with real isolated GNOME dual monitors, native DMA-BUF capture, and a real Windows FFmpeg GDI consumer. The old fractional-scale output drops the desktop panel; the revised output preserves the whole image. No test scripts added.

---------

Co-authored-by: Xuc Pan <[email protected]>
2026-10-18 00:18:41 +08:00
2026-09-05 21:30:26 +08:00
2026-10-13 15:31:16 +08:00
2026-10-13 15:31:16 +08:00
2026-09-05 13:04:29 +08:00
2026-10-13 15:31:16 +08:00
2026-10-13 15:31:16 +08:00
2026-09-05 13:04:29 +08:00
2026-09-05 13:04:29 +08:00
2026-09-05 13:04:29 +08:00
2026-10-13 15:31:16 +08:00
2026-10-13 15:31:16 +08:00

UU Remote icon

uur

A native Linux compatibility layer for the official NetEase UU Remote client.

Linux x86_64 X11 and Wayland Rust MIT license

English · 简体中文

Important

uur does not redistribute UU Remote. It downloads the official Windows installer from NetEase after the user explicitly accepts the upstream EULA.

✨ Highlights

Capability Linux integration
Control other computers Official UU interface and media stack under Wine
Allow this Linux computer to be controlled ScreenCast portal/PipeWire capture and native Linux input
X11 and Wayland Capability detection instead of distribution or desktop allowlists
Clean lifecycle Bridges start with UU and stop with its managed Wine prefix
Native tools Linux PTY terminal, wallpaper, Quick Launch, proxy, and sleep inhibition
Upstream resilience API-level runtime adapters; no version/RVA patch matrix
Distribution Arch/pacman, deb, rpm, portable tar.zst, and an AUR recipe

🚀 First run

After installing any package, run these commands in this order:

# 1. Inspect the current Wine, portal, PipeWire, and input capabilities.
uur doctor

# 2. Accept NetEase's EULA, download the official client, and create the prefix.
uur setup --accept-eula

# 3. Start capture, input, the managed Wine services, and the UU interface.
uur run

uur setup without --accept-eula intentionally stops after printing the official EULA URL. It does not install the proprietary client.

Many capabilities remain untested; runtime testing so far covers Arch Linux, KDE Plasma, and Wayland.

After setup, UU Remote is also available from the application menu. The menu entry launches the complete uur run session.

📦 Installation

Download the newest package for the system from the GitHub Releases page. Native recipes and release artifacts share one version and filesystem layout.

Arch Linux

Install a downloaded release package with pacman:

sudo pacman -U ./dist/uur-0.1.5-1-x86_64.pkg.tar.zst

AUR

After the package is available from AUR:

paru -S uur

Debian and Ubuntu package family

sudo apt install ./uur_0.1.5_amd64.deb

Fedora and compatible RPM systems

sudo dnf install ./uur-0.1.5-1.x86_64.rpm

On systems with different RPM dependency names, install the dependencies manually or use the portable archive.

Portable archive

sudo tar --zstd -C / -xf ./uur-0.1.5-linux-x86_64.tar.zst

Nix and NixOS

nix build
nix run . -- doctor

The flake also exports nixosModules.default; see Nix and NixOS.

Alpine Linux

Alpine edge can build the native musl package layout with:

docker build -f packaging/alpine/Dockerfile .

An APKBUILD is included under packaging/alpine/.

User installation from source

cargo build --release --locked
./hook/build.sh
./capture/build.sh
./scripts/install-user.sh

The source build requires Rust, a C compiler, PipeWire development files, pkg-config, and the MinGW-w64 x86_64 toolchain.

Gentoo, Void Linux, Slackware, Solus, ALT Linux, Exherbo, Clear Linux, Mageia, OpenMandriva, PCLinuxOS, Venom Linux, Guix System, and other package ecosystems can use the portable archive or the shared packaging/stage.sh source layout.

See Platform support and usage for distribution families, portal choices, X11/Wayland sessions, standalone window managers, immutable systems, and libc boundaries.

🧭 Daily use

uur run                 # Start or show the managed UU session
uur doctor              # Read-only environment diagnostics
uur upstream check      # Check the official NetEase release feed
uur autostart enable    # Optional: start after graphical login
uur autostart disable   # Remove the managed login entry
uur wol status          # Inspect the physical wired adapter's WOL state
uur display status      # Monitor, window, or portal virtual source
uur display source virtual
uur display outputs     # Native Wayland output names
uur stop                # Stop only uur's helpers and Wine prefix
uur uninstall --purge --dry-run  # Preview complete user-data cleanup
uur uninstall --purge   # Confirm cleanup before removing the system package

If UU was started from the desktop, choose Quit from the launcher's application actions. When running from a terminal, use uur stop or press Ctrl+C.

On niri, uur provides a native tray and an explicitly enabled direct capture path: uur display backend wayland --output DP-1 (use your output name). This uses uinput and captures the chosen monitor without a portal dialog. Return to system-consented capture with uur display backend portal.

Package removal alone preserves the Wine prefix and account data. See complete removal for the user-cleanup and package-manager steps.

Diagnostic input overrides:

UUR_INPUT_BACKEND=portal uur run
UUR_INPUT_BACKEND=uinput uur run
UUR_INPUT_BACKEND=xtest uur run

Use the default auto mode after troubleshooting.

🖥️ Desktop integration

  • A Wayland session with both RemoteDesktop and ScreenCast portals uses one combined, unprivileged session for input and video.
  • A Wayland session with only ScreenCast uses PipeWire for video and uinput for full-desktop input.
  • An X11 session uses Wine's native X11 capture and XTest input.
  • XTest under XWayland is only a partial fallback and is not advertised as full Wayland desktop control.

Run uur doctor instead of inferring support from a desktop or distribution name.

🧩 Native Linux features

Screen capture, keyboard, pointer, lifecycle management, wallpaper metadata, native terminal, Quick Launch, proxy synchronization, suspend inhibition, and host WOL configuration are implemented. Quick Launch exposes the XDG application catalog through UU and resolves each request back to gio launch; it never accepts an arbitrary command from Wine. Other UU features require native Linux service adapters rather than being left inside the Wine prefix:

Feature Direction
Terminal Authenticated UU transport → native PTY and the user's login shell
Quick Launch UU application inventory → authenticated XDG desktop activation
Wake-on-LAN setup uur wol → real wired interface and NetworkManager profile
Received files Validated staging → the user's XDG Downloads directory
Sending files File portal or explicit CLI selection → bounded native staging
Port mapping Policy-controlled native TCP/UDP broker; loopback by default
Clipboard and phone text RemoteDesktop Clipboard portal with X11 fallback

The protocol, security boundaries, lifecycle, and implementation phases are in Native service adapters.

🔬 How it works

Official UU Remote client (managed Wine prefix)
        │
        ├─ Windows API adapter ── authenticated input/control protocol
        │
        └─ GDI/DXGI capture boundary ◄── private triple-buffer frame transport
                                              ▲
Linux supervisor ── ScreenCast portal ── PipeWire
        │
        └─ RemoteDesktop portal / uinput / XTest

The Windows ABI adapter is small C code. Session policy, desktop integration, capability selection, and lifecycle management are implemented in Rust.

🛠️ Troubleshooting

Start with:

uur doctor

Session logs are stored at:

${XDG_STATE_HOME:-$HOME/.local/state}/uur/session.log

For Wine diagnostics only:

WINEDEBUG=+loaddll uur run

Normal runs suppress Wine's non-actionable fixme output.

📚 Documentation

🙏 Credits

The project learned from GuoWQ222/uu-remote-for-linux, lachlanchen/uu-remote-ubuntu-bridge.

NetEase UU Remote is proprietary software of NetEase. uur is an unofficial compatibility project and is not affiliated with NetEase.

Languages
Rust 59%
C 36%
Shell 4.3%
Nix 0.6%
Dockerfile 0.1%