From 30264cb151f4162bd3990a301e8f78571fa8dc66 Mon Sep 17 00:00:00 2001 From: roboomp Date: Fri, 7 Aug 2026 06:42:16 +0000 Subject: [PATCH] fix(natives): port wayland capture to pipewire 0.9 Rc handle API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit capture.rs still constructed the PipeWire main loop and context via the 0.8 owning constructors (MainLoop::new / Context::new / connect_fd), which pipewire 0.9.2 removed in favour of the Rc handle types. The migration was partial — StreamBox::new was already 0.9 — so the wayland-pipewire feature failed to compile with E0599. Switch to MainLoopRc::new / ContextRc::new(&loop, None) / connect_fd_rc. The downstream call sites are unchanged: MainLoopRc derefs to MainLoop (run/quit/clone), ContextRc derefs to Context, and CoreRc derefs to Core so StreamBox::new(&core, ...) still coerces. Fixes #7885 --- crates/pi-natives/src/desktop/linux/wayland/capture.rs | 8 ++++---- packages/natives/CHANGELOG.md | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/pi-natives/src/desktop/linux/wayland/capture.rs b/crates/pi-natives/src/desktop/linux/wayland/capture.rs index 04a1eae94..f08b55796 100644 --- a/crates/pi-natives/src/desktop/linux/wayland/capture.rs +++ b/crates/pi-natives/src/desktop/linux/wayland/capture.rs @@ -147,11 +147,11 @@ fn rgba_from_buffer( fn grab_pipewire_frame(node: u32, fd: OwnedFd) -> Result { pw::init(); let mainloop = - pw::main_loop::MainLoop::new(None).map_err(|err| format!("PipeWire main loop: {err}"))?; - let context = - pw::context::Context::new(&mainloop).map_err(|err| format!("PipeWire context: {err}"))?; + pw::main_loop::MainLoopRc::new(None).map_err(|err| format!("PipeWire main loop: {err}"))?; + let context = pw::context::ContextRc::new(&mainloop, None) + .map_err(|err| format!("PipeWire context: {err}"))?; let core = context - .connect_fd(fd, None) + .connect_fd_rc(fd, None) .map_err(|err| format!("PipeWire remote: {err}"))?; let stream = pw::stream::StreamBox::new(&core, "omp-computer-capture", properties! { *pw::keys::MEDIA_TYPE => "Video", diff --git a/packages/natives/CHANGELOG.md b/packages/natives/CHANGELOG.md index 04d2f4b98..47ef3e235 100644 --- a/packages/natives/CHANGELOG.md +++ b/packages/natives/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fixed the `wayland-pipewire` Cargo feature failing to compile: the PipeWire capture path still used the removed 0.8 `MainLoop::new` / `Context::new` / `connect_fd` constructors instead of the 0.9 `MainLoopRc` / `ContextRc` / `connect_fd_rc` handle API ([#7885](https://github.com/can1357/oh-my-pi/issues/7885)). + ## [17.2.10] - 2026-08-06 ### Fixed