From f2082f8b57f12c0989f45e99b069a3463be2668a Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 22 Jul 2026 12:25:48 +0200 Subject: [PATCH] fix(windows/capture): drop redundant unsafe at the poller-spawn CCD call (inside open_on's unsafe region) Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/pf-capture/src/windows/idd_push.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/pf-capture/src/windows/idd_push.rs b/crates/pf-capture/src/windows/idd_push.rs index 987ba031..949d854e 100644 --- a/crates/pf-capture/src/windows/idd_push.rs +++ b/crates/pf-capture/src/windows/idd_push.rs @@ -1020,11 +1020,10 @@ impl IddPushCapturer { // hardware cursor keeping the frame cursor-free, the poller supplies the full-fidelity // shape (masked/monochrome included — the IddCx query can't; see cursor_poll.rs). let cursor_poll = cursor_shared.as_ref().map(|_| { - // SAFETY: `source_desktop_rect` only runs the CCD QueryDisplayConfig FFI over - // owned locals (same call CursorShared::create makes for its origin). - let rect = - unsafe { pf_win_display::win_display::source_desktop_rect(target.target_id) } - .unwrap_or((0, 0, i32::MAX, i32::MAX)); + // Safety of the CCD call: read-only QueryDisplayConfig over owned locals (same + // call CursorShared::create makes) — already inside open_on's unsafe region. + let rect = pf_win_display::win_display::source_desktop_rect(target.target_id) + .unwrap_or((0, 0, i32::MAX, i32::MAX)); cursor_poll::CursorPoller::spawn(target.target_id, rect) });