Skip to content

rust: Port util/platform-nix-inhibit.c to obs-util #1500

Closed

Description

@rdoupe

Unit

Port libobs/util/platform-nix-inhibit.c.h to obs-util: the Linux and FreeBSD os_inhibit_sleep_create, os_inhibit_sleep_set_active and os_inhibit_sleep_destroy.

Phase and position

Phase 4 (platform utilities). The file was split out of platform-nix.c in #454, so the portal and D-Bus sleep inhibitors stay when the rest of platform-nix is ported (#403 had dropped them, #453).

Dependencies and existing tests

Calls the D-Bus (platform-nix-dbus.c.h) and portal (platform-nix-portal.c.h) inhibitors, which stay C for now (GDBus). The Rust port keeps calling them through their C functions. The GIO-gated paths depend on GIO_FOUND from CMake, which has to reach the Rust build.

test_inhibit_sleep_dbus exists. First audit what it covers (it must run, not skip, against libobs-with-rust), and add a C-only characterization test for the other paths (no session bus, no portal, repeated activate/deactivate, destroy while active) before the port.

Notes

Preserve public headers, exported signatures and existing C tests. The port follows RED then GREEN with Tier 1 tests, the symbol and layout checks, differential parity against the C oracle where the behaviour is observable, and unchanged Tier 2 OFF/ON. No intended behaviour changes.

Current authorized work is the claim and characterization; the Rust implementation follows in its own PR.

Activity

  1. rdoupe commented on Oct 20, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1500

    Plan:

    1. Characterization PR (C only): audit test_inhibit_sleep_dbus against both lanes, then pin the other paths (no session bus, no portal, repeated activate/deactivate, destroy while active). The port won't edit it.
    2. Port PR: obs-util under src/platform/unix, shim swap, Tier 1, symbol and layout checks, parity against the C oracle, Tier 2 OFF/ON unchanged. Keeps calling the C D-Bus and portal inhibitors.

    First PR expected within a day.

  2. added
    claimed
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions