Commit Graph
9 Commits
Author SHA1 Message Date
迢辰andXuc Pan a5e2aa44cd fix(capture): map the DMA-BUF frames niri actually sends (#26)
* fix(capture): map the DMA-BUF frames niri actually sends

`uur run` reported "No Wayland frames arrived within 120 seconds" on a
session where the portal handshake succeeded. The session log showed the
stream never leaving negotiation:

    portal session ready (video node 73)
    stream state: connecting
    stream state: paused
    stream state: error - no more input formats
    stream state: unconnected

Three separate defects in `uur-pw-capture`:

1. The format filter omitted `modifier`. niri marks that property
   MANDATORY (SPA flags 0x18), and SPA filtering fails unless both sides
   carry a mandatory property -- which surfaces as "no more input
   formats". The filter now advertises LINEAR, the layout the frame
   protocol already assumes.

2. `on_process` only handled `data != NULL` and `SPA_DATA_MemFd`. niri
   delivers SPA_DATA_DmaBuf planes, which carry an fd and no pointer, so
   every frame was dropped in silence. Since the session negotiates
   LINEAR, that fd is directly mappable without GBM/EGL; the helper now
   mmaps it. A non-linear modifier is refused instead of publishing
   garbage.

3. DMA-BUF producers leave `chunk->size` and `maxsize` at 1. Both the
   mapping length and the row count were derived from those, so the mmap
   covered one byte and `rows` came out zero -- publishing an all-black
   frame. Both now use the negotiated stride and height.

Verified on niri 26.04 with Wine 11.19: the stream reaches `streaming`,
~60 fps (1195 frames in 20 s), and the published frame decodes to the
real desktop rather than black.

* fix(capture): validate DMA-BUFs and recover interrupted screen streams

Use immutable transport files across geometry changes and remap Wine readers safely. Bound stream recovery and preserve portal stop-sharing intent. Refs #29.

* fix(capture): watch Mutter layout changes and support older build headers

* fix(capture): keep display changes outside the failure retry budget

* fix(capture): honor portal stop signals during GNOME recovery

Subscribe before starting on the portal-owned D-Bus connection and accept the real Session.Closed dictionary body. Correlate Mutter's close-before-MonitorsChanged ordering without restarting an explicit Stop Sharing session.

Verified in a private GNOME 51.1 namespace with real GBM DMA-BUF, 100/125 percent scaling, portrait and landscape, and native Stop Sharing. Existing 48 tests and strict clippy pass. Real Wine GDI reader captured 120 final-run frames across four layout changes with no hook fallbacks. No test scripts added.

---------

Co-authored-by: Xuc Pan <[email protected]>
2026-10-15 16:57:34 +08:00
迢辰andXuc Pan bfecaa5c69 fix(wine): select the client root that actually holds bin/ (#24)
* fix(wine): select the client root that actually holds bin/

`uur run` aborted with "WebView2 bootstrapper missing from the client
directory" on a complete install.

`find_client_dir` searched depth-first for `GameViewerServer.exe` and
returned the first hit, special-casing only a parent named `bin`. NetEase
ships the payload twice: as `<root>/bin/` and as a sibling
`<root>/<version>/`. When readdir order reached `<root>/<version>/` first,
that directory was returned as the client root. It has no `bin/`
subdirectory, so every `join("bin")` lookup missed -- the WebView2
bootstrapper and the terminal proxies -- and the session bailed out.
`deploy_terminal_proxy` then created a spurious `bin/` inside the version
directory and wrote proxies into it.

Now every directory holding `GameViewer.exe` is collected and ranked:
`bin/GameViewerServer.exe` scores highest because that is the layout uur
drives, then `bin/MicrosoftEdgeWebview2Setup.exe`, then a top-level
server. Ties break on path depth, then lexically, so the choice no longer
depends on readdir order. A versioned copy is still used when it is the
only candidate.

Adds four tests covering both layouts, readdir stability, and the
fallback.

* fix(wine): require complete payloads and support flat client layouts

---------

Co-authored-by: Xuc Pan <[email protected]>
2026-10-15 14:44:00 +08:00
Xuc Pan 8c0589021f fix: repair Wine setup and niri capture, input and tray (#22)
* fix(setup): verify provisioning and runtime readiness

* feat: add explicit per-user uninstall and purge

* fix: restore niri input and provide native capture and tray

* fix(build): declare Wayland scanner and release dependencies
2026-10-13 15:26:06 +08:00
Xuc Pan 3c78382f20 test(session): cover first deployment from readonly source 2026-10-05 23:24:53 +08:00
Xuc Pan 2833b08a37 fix(session): make prefix deployment repeatable 2026-10-05 23:19:31 +08:00
Xuc Pan 5245c9ee61 fix(desktop): improve HiDPI and exit integration 2026-09-25 03:04:51 +08:00
Xuc Pan 9f12a88a08 fix(desktop): improve HiDPI and exit integration 2026-09-25 03:04:51 +08:00
Xuc Pan 17a09e08a5 fix(wine): use builtin DLLs for WebView2 setup 2026-09-23 09:00:41 +08:00
Xuc Pan 611383544b Initial commit 2026-09-05 13:04:29 +08:00