fix: m0 portal capture — activate the capturer so frames are delivered

The M2 teardown work added an `active` gate to the PipeWire capture callback
(idle by default so reconnects stay cheap, with the stream path calling
set_active(true) on PLAY). The `m0` subcommand was never updated, so its portal
capturer stayed inactive and the callback dropped every frame — `m0 --source
portal` failed with "no PipeWire frame within 10s" on every compositor. Call
set_active(true) before the capture loop.

Validated on headless KWin (Plasma 6.4) via the RemoteDesktop-anchored ScreenCast
session: real desktop frames flow (shm BGRx 1920x1080) and encode to valid H.265.

(Also folds in a rustfmt reflow of the input-test log line.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 14:24:09 +00:00
parent 957b33f077
commit 959ddc5b5c
2 changed files with 7 additions and 1 deletions
+4
View File
@@ -59,6 +59,10 @@ pub fn run(opts: Options) -> Result<()> {
}
};
// Activate the capturer so the portal/PipeWire process callback actually delivers frames
// (it gates the per-frame de-pad on `active`; idle by default so reconnects are cheap).
capturer.set_active(true);
// The first frame establishes the authoritative dimensions (the portal's negotiated
// size, or the synthetic size) used to configure the encoder.
let first = capturer.next_frame().context("capture first frame")?;