Skip to content

rust: Port libobs/obs-hotkey-dispatch.c.h to obs-hotkey #5329

Closed

Description

@zackees

Port the complete libobs/obs-hotkey-dispatch.c.h unit to obs-hotkey after the C-only prerequisite #5327 merges. This is the Phase 6 internal hotkey callback seam used by rust/obs-hotkey/src/ffi/binding_press.rs, not a hotkey lookup or registration API.

Preserve the C behavior pinned by test/cmocka/test_hotkey_dispatch.c: direct callback versus router selection; exact callback data, ID and hotkey identity; press/release and duplicate forwarding; no binding lookup and no pressed-count mutation; installed router ignored when rerouting is disabled; missing router no-op when enabled, including NULL hotkey in that branch; zero-initialized subsystem with a valid direct callback. Live core and delivered-path pointer/callback preconditions remain unchanged. Do not introduce NULL dereferences through field adapters before branch selection.

Implement the safe Rust selection core and thin private ABI shim, using real C-owned core/callback adapters for layout-dependent fields and native callback ABI calls. No copied core layout, placeholder globals or aborting link stubs. Reuse the characterization fixture's external seam so unchanged C assertions exercise the actual Rust implementation. Account for every existing isolated monolith consumer and Rust-static fixture, retain one amalgamated Core state Rust test binary, and verify Linux/MSVC/Darwin linking.

Follow RED then GREEN. Tier 1 ports every C assertion into safe Rust; Tier 2 runs unchanged C tests against hybrid and C-reference libobs with exact symbol parity; Tier 3 compares original C with the Rust shim (including a mutation check); network Tier 4 does not apply. Move the entire extracted file into its ported unity group and register metadata/exports as appropriate. Preserve public headers and existing C tests.

Dependency: #5327 must merge first. Adapter-adding work must honor the #5246 shared-link-support hold: do not add link_support fragments while that hold applies; keep a dependent PR draft if real adapter linkage cannot be provided without them. This issue is the separate Rust swap, not permission to expand the C-only prerequisite.

Activity

  1. added
    port
    ready
    P2
    size:S
    on Nov 20, 2026
  2. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Claiming: the Rust swap of libobs/obs-hotkey-dispatch.c.h into obs-hotkey. The C-only prerequisite (#5337, Refs #5327) is on master. Plan: RED with the Tier 1 assertions and Tier 3 parity against stubs, then GREEN with the safe selection core, a thin private shim over C-owned core/callback adapters, the unchanged C characterization replayed against hybrid and the C reference, and the extracted file moved into its ported group.

  3. moved this from Blocked to In progress in obs-rust Multiviewon Nov 21, 2026
  4. rdoupe commented on Nov 21, 2026

    @rdoupe
    Collaborator

    Done in #5399 (merged as 1730fee): obs-hotkey-dispatch.c.h is in its ported group and the master push runs after it are green.

  5. moved this from In progress to Done in obs-rust Multiviewon Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2portreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions