Skip to content

rust: Port libobs/obs-hotkey-inject-entry.c.h to obs-hotkey #5192

Closed

Description

@zackees

Unit

Port libobs/obs-hotkey-inject-entry.c.h to obs-hotkey, replacing the public obs_hotkey_inject_event dispatch wrapper and its private event adapter as one whole-file Rust swap. Keep the already Rust-backed per-binding engine; do not duplicate or redesign it.

Phase and position

Phase 6 hotkey dispatch orchestration, after the C-only characterization and extraction prerequisite #5174 has landed. Refs #1751 and #1836. The prerequisite preserves the public C API and the unchanged C++ OBS WebSocket plugin.

Dependencies and existing tests

Blocked by #5174. Reuse obs_hotkey_seam_lock, obs_hotkey_seam_unlock and obs_hotkey_seam_enum_bindings; the binding array remains C-owned. The prerequisite adds test_hotkey_inject_entry.c, a portable wrapper recorder using real headers. Relink that fixture unchanged to the Rust replacement and real adapters instead of retaining a C-only wrapper test.

Preserve unchanged test_hotkey_press_state.c injection cases (repeated press, injected false events, strict/background behavior, modifier-only and empty-binding oddities), test_hotkey_load.c, test_hotkey_unregister.c, and all ten whole-hotkey fixtures registered in the graph and independent native inventories.

Required behavior and validation

No core is a silent no-op. Acquire the hotkey lock before capturing strict modifiers; construct one event with the exact key, all modifier bits and pressed value; enumerate the current binding array in order; pass the same captured strict flag throughout; then unlock. Forward false events to the existing binding engine. Preserve callback/lock/read order and current mutation semantics without introducing a new enumeration design.

Commit failing safe Rust Tier 1 stubs before GREEN. Mirror every applicable C assertion and add the wrapper recorder cases in the existing obs-data Core state binary (soldr cargo test -p obs-data --test obs-tests-core, owning obs-hotkey modules); add no executable. Add real-header size/alignment/all-field-offset checks for any FFI layout. Tier 2 retains the unchanged C tests against C-reference and hybrid libobs, with identical exported public symbols. Tier 3 compares the extracted original C oracle, the thin Rust ABI shim and the safe core using bounded edge/random inputs, and demonstrates a failing mutation.

Any new C field adapter checks NULL owners in Rust before access where the original permits NULL. Link real private adapters into every affected standalone Rust-static consumer through tests.d support and matching sorted graph/inventories; no aborting stubs or fake core globals. Validate Windows MSVC workspace test links and a focused Linux Tier 2 build of unrelated *_rust targets, because adapters can introduce archive-member dependencies beyond hotkeys. Run the whole native_build:: module and repository lint. Platform C long types must use c_long/c_ulong directly, without a Windows-useless conversion. Avoid host-dependent defaults, generated names and paths; macOS/Windows Tier 2 also reuses CMake test executables with Cargo-native obs-c-reference.

Run the existing Tier 4 TriggerHotkeyByKeySequence cases in test/websocket-tier4/run_tier4.py with the unchanged C++ plugin loaded by both library builds. Do not change public headers, existing C tests, the WebSocket plugin, workflows or unrelated hotkey units. Source/oracle/export fragments and real-adapter support must agree with native registrations. Claim only after #5174 lands and this issue remains Ready/unclaimed.

Activity

  1. added
    portPort a C unit to Rust (four-tier policy)
    readyMeets the definition of Ready; claimable
    P2Normal priority
    on Nov 19, 2026
  2. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Claiming: Rust hotkey injection entry swap in pool slot obs-studio6, branch port/5192-hotkey-inject-entry. 1. Commit failing safe Rust mirrors of the #5193 recorder. 2. Implement the swap using existing hotkey seams, add real-header layout and Tier 3 parity/mutation coverage. 3. Run hotkey/native_build tests, unchanged Linux characterization, every *_rust cmocka link, Windows link check, formatting and lint; publish subject to backpressure. First PR expected this session.

  3. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Landed on master in #5206 (9d7600e): hotkey injected-event dispatch now runs in Rust in obs-hotkey. The unregistration swap #5198 is unblocked.

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

Metadata

Metadata

Assignees

Labels

P2Normal priorityportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimablesize:SHours

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions