From 6fb00123b7574d45e424958b807d46e5db654d8d Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 08:09:56 -0800 Subject: [PATCH 1/2] test: characterize hotkey background state and require extraction (RED, Refs #5255) --- test/cmocka/build/test-graph.json | 24 ++++ test/cmocka/test_hotkey_background_state.c | 119 ++++++++++++++++++ .../test_hotkey_background_state.cmake | 1 + 3 files changed, 144 insertions(+) create mode 100644 test/cmocka/test_hotkey_background_state.c create mode 100644 test/cmocka/tests.d/test_hotkey_background_state.cmake diff --git a/test/cmocka/build/test-graph.json b/test/cmocka/build/test-graph.json index b3a477afe2..45d4bbce0e 100644 --- a/test/cmocka/build/test-graph.json +++ b/test/cmocka/build/test-graph.json @@ -6130,6 +6130,24 @@ } ] }, + "test_hotkey_background_state": { + "libraries": [ + "OBS::libobs", + "OBS::caption", + "Uthash::Uthash", + "OBS::native-test-cmocka", + { + "name": "OBS::w32-pthreads", + "requires": "OS_WINDOWS" + } + ], + "sources": [ + "test/cmocka/test_hotkey_background_state.c" + ], + "header_libraries": [ + "SIMDe::SIMDe" + ] + }, "test_hotkey_background_trigger": { "sources": [ "libobs/obs-hotkey-binding-press.c.h", @@ -24153,6 +24171,12 @@ ], "suite": "core" }, + "test_hotkey_background_state": { + "command": [ + "${target}" + ], + "target": "test_hotkey_background_state" + }, "test_hotkey_background_trigger": { "target": "test_hotkey_background_trigger", "command": [ diff --git a/test/cmocka/test_hotkey_background_state.c b/test/cmocka/test_hotkey_background_state.c new file mode 100644 index 0000000000..80d13d720a --- /dev/null +++ b/test/cmocka/test_hotkey_background_state.c @@ -0,0 +1,119 @@ +/* Characterize the C wrapper before its Rust swap, without a desktop or threads. + * The recording core accessor rejects eager/background reads outside the lock. */ +#include +#include +#include +#include +#include +#include "libobs/build/libobs.pch.h" + +static struct obs_core core; +static bool lock_result, locked; +static unsigned locks, unlocks, reads; +static uint32_t *output; +static uint32_t expected_flags; +static enum obs_hotkeys_background_state expected_state; + +static struct obs_core *record_core(void) +{ + assert_true(locked); + reads++; + return &core; +} + +static inline bool lock(void) +{ + assert_false(locked); + assert_int_equal(locks, 0); + assert_int_equal(reads, 0); + /* Clearing the optional output precedes even a failed lock attempt. */ + if (output) + assert_int_equal(*output, 0); + locks++; + locked = lock_result; + /* Fields become current only when the lock succeeds. */ + core.hotkeys.background.state = expected_state; + core.hotkeys.background.flags = expected_flags; + return lock_result; +} + +static inline void unlock(void) +{ + assert_true(locked); + assert_int_equal(locks, 1); + assert_int_equal(unlocks, 0); + assert_int_equal(reads, output ? 2 : 1); + if (output) + assert_int_equal(*output, expected_flags); + /* The returned state must be captured before releasing the lock. */ + core.hotkeys.background.state = OBS_HOTKEYS_BACKGROUND_NATIVE; + core.hotkeys.background.flags = 0; + locked = false; + unlocks++; +} + +#ifndef HOTKEY_BACKGROUND_STATE_EXTERNAL +#ifndef HOTKEY_BACKGROUND_STATE_SOURCE +#define HOTKEY_BACKGROUND_STATE_SOURCE "libobs/obs-hotkey-background-state.c.h" +#endif +#define obs record_core() +#include HOTKEY_BACKGROUND_STATE_SOURCE +#undef obs +#endif + +static void query(bool success, bool with_flags, enum obs_hotkeys_background_state state, uint32_t flags) +{ + memset(&core, 0, sizeof(core)); + lock_result = success; + locked = false; + locks = unlocks = reads = 0; + expected_state = state; + expected_flags = flags; + uint32_t value = UINT32_MAX; + output = with_flags ? &value : NULL; + enum obs_hotkeys_background_state result = obs_hotkeys_get_background_state(output); + assert_int_equal(result, success ? state : OBS_HOTKEYS_BACKGROUND_NATIVE); + assert_int_equal(value, with_flags ? (success ? flags : 0) : UINT32_MAX); + assert_int_equal(locks, 1); + assert_int_equal(unlocks, success ? 1 : 0); + assert_int_equal(reads, success ? (with_flags ? 2 : 1) : 0); + assert_false(locked); +} + +static void failed_lock(void **unused) +{ + (void)unused; + query(false, true, OBS_HOTKEYS_BACKGROUND_ACTIVE, UINT32_MAX); + query(false, false, OBS_HOTKEYS_BACKGROUND_ACTIVE, UINT32_MAX); +} + +static void states_and_flags(void **unused) +{ + (void)unused; + const enum obs_hotkeys_background_state states[] = { + OBS_HOTKEYS_BACKGROUND_NATIVE, + OBS_HOTKEYS_BACKGROUND_ACTIVE, + OBS_HOTKEYS_BACKGROUND_STARTING, + OBS_HOTKEYS_BACKGROUND_IDLE, + OBS_HOTKEYS_BACKGROUND_WAITING, + OBS_HOTKEYS_BACKGROUND_DECLINED, + OBS_HOTKEYS_BACKGROUND_CLOSED, + OBS_HOTKEYS_BACKGROUND_FAILED, + OBS_HOTKEYS_BACKGROUND_UNAVAILABLE, + /* Characterized, not endorsed: unknown native enum values pass through. */ + (enum obs_hotkeys_background_state)12345, + }; + const uint32_t flags[] = {0, 1, UINT32_C(0x80000000), UINT32_C(0xa5a51234), UINT32_MAX}; + for (size_t s = 0; s < sizeof(states) / sizeof(states[0]); s++) { + for (size_t f = 0; f < sizeof(flags) / sizeof(flags[0]); f++) { + query(true, true, states[s], flags[f]); + query(true, false, states[s], flags[f]); + } + } +} + +int main(void) +{ + const struct CMUnitTest tests[] = {cmocka_unit_test(failed_lock), cmocka_unit_test(states_and_flags)}; + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/test/cmocka/tests.d/test_hotkey_background_state.cmake b/test/cmocka/tests.d/test_hotkey_background_state.cmake new file mode 100644 index 0000000000..097d1362a9 --- /dev/null +++ b/test/cmocka/tests.d/test_hotkey_background_state.cmake @@ -0,0 +1 @@ +# Both target and test are declared in ../build/test-graph.json. From 9028566f07400aa6ce008b993dcfb885f05cc29e Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 08:13:40 -0800 Subject: [PATCH 2/2] libobs: extract hotkey background state wrapper verbatim (Refs #5255) Ci-Attestation: {"at":1795106368,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":126,"stamp":"fcfc120c8442c4108edf56fb689498a1","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106368,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":126,"stamp":"665506a4c617c3d64dfcbc01f7313e91","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106368,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":126,"stamp":"fbbf57e544d3869f31a79dae8f085268","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106368,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":126,"stamp":"f506eedb0864b42d2c9564b31fd467c0","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106240,"gate":"general/all/client-lint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"52f7fa031a2de12a8d46278585529409","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106368,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":126,"stamp":"516504df571f1d4ab330d4ab0c1d018e","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"6752301a6f2d891ab216e8c1f8a72026","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"ce0575c64345e33243d053fca8511925","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"bb753c98675b9cb64409ac2843262781","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"10cfeb29b4f614dfcd22c8dd2417f3d0","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106240,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"2a230300efe27a25f2e624f969f1cadb","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106240,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"5a8d1d6c06bef5a5fbde82aecb2ef54c","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"672074ee6c5fa9bea4f9f06b183892f0","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"68cad3267447b50d8b7d90d1336db8bf","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"6db50835367b62d18780c91c82cecb3b","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106241,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"7c4daef1ba9b47da8d632518bfe587e3","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106240,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"ff8c3cbcaafdf1d89274eaa27b58258b","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106240,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"d69b79dbc11bd4f360766d2bd787c14d5ff293f8e9e7c1459df7ab178434f601","lane":"client-lint","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":216,"stamp":"f4add3d3102a7b8bdb5ff7231a63dbde","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Ci-Attestation: {"at":1795106916,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"8cb8a0d4af3f544b3f90a66d72f90831a37ba35e36a1c3b911b421492c1cc16e","lane":"client-test-x86_64-unknown-linux-gnu","parents":["6fb00123b7574d45e424958b807d46e5db654d8d"],"secs":546,"stamp":"5c9475221a3a7725f2029ffeed4187bd","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237","v":1,"via":"run"} Client-Checks: {"checks":{"base":"9135554e3e5b9c608f75794f930709ea15dd2af8","coverage":"all-tracked-applicable-files","diff":["ci/test_hotkey_register_extraction.py","libobs/build/libobs.core+.h.c","libobs/obs-hotkey-background-state.c.h","libobs/obs-hotkey.c.h","rust/obs-build/tests/native/registration/headless_characterizations_expected.json","rust/obs-build/tests/native/registration/portal_output_expected.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_enum.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_press.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_trigger.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_binding_press_steps.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_getters_characterization.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_load.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_pair_steps.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_press_steps.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_unregister_entry.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_portal_shortcuts.json","rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_wayland_hotkeys.json","test/cmocka/build/test-graph.json","test/cmocka/test_hotkey_background_state.c","test/cmocka/tests.d/test_hotkey_background_state.cmake"],"head":"aec7c0329d686e25ba48cf5f7272d964c1abc6a3","tools":{"orchestrator-python":"3.14.7 (main, Aug 14 2026, 15:35:28) [Clang 22.1.3 ]","schema-dependencies":"3.14.7 (main, Aug 14 2026, 15:35:28) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"c6f2bfd0c074229baad4b077982b3e6b4aad7101646304f9121e808ff1d3c019","tree":"164f766f0959e7a2d50991fdc3cc0faa3ab64237"}} --- ci/test_hotkey_register_extraction.py | 4 +++- libobs/build/libobs.core+.h.c | 1 + libobs/obs-hotkey-background-state.c.h | 19 ++++++++++++++++ libobs/obs-hotkey.c.h | 14 ------------ .../headless_characterizations_expected.json | 2 ++ .../registration/portal_output_expected.json | 2 ++ .../test_hotkey_background_enum.json | 2 ++ .../test_hotkey_background_press.json | 2 ++ .../test_hotkey_background_trigger.json | 2 ++ .../test_hotkey_binding_press_steps.json | 2 ++ .../test_hotkey_getters_characterization.json | 2 ++ .../hotkey-control/test_hotkey_load.json | 2 ++ .../test_hotkey_pair_steps.json | 2 ++ .../test_hotkey_press_steps.json | 2 ++ .../test_hotkey_unregister_entry.json | 2 ++ .../hotkey-control/test_portal_shortcuts.json | 2 ++ .../hotkey-control/test_wayland_hotkeys.json | 2 ++ test/cmocka/build/test-graph.json | 22 +++++++++++++++++++ 18 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 libobs/obs-hotkey-background-state.c.h diff --git a/ci/test_hotkey_register_extraction.py b/ci/test_hotkey_register_extraction.py index 9c4c2b3797..effde6f92e 100644 --- a/ci/test_hotkey_register_extraction.py +++ b/ci/test_hotkey_register_extraction.py @@ -45,7 +45,9 @@ def test_isolated_cores_compile_registration_in_the_same_translation_unit(self): self.assertIn(EXTRACTED, target["sources"]) self.assertEqual(target.get("pch"), "libobs/build/libobs.pch.h") groups = list(target.get("unity_groups", {}).values()) - self.assertIn([EXTRACTED, ORIGINAL], groups) + self.assertIn( + [EXTRACTED, "libobs/obs-hotkey-background-state.c.h", ORIGINAL], groups + ) self.assertCountEqual( [source for group in groups for source in group], target["sources"] ) diff --git a/libobs/build/libobs.core+.h.c b/libobs/build/libobs.core+.h.c index 401b587f52..4f39379c9b 100644 --- a/libobs/build/libobs.core+.h.c +++ b/libobs/build/libobs.core+.h.c @@ -23,6 +23,7 @@ #include "libobs/obs-hotkey-background-enum-fields.c.h" #include "libobs/obs-hotkey-background-error-fields.c.h" #include "libobs/obs-hotkey-background-press-fields.c.h" +#include "libobs/obs-hotkey-background-state.c.h" #include "libobs/obs-hotkey-background-trigger-fields.c.h" #include "libobs/obs-hotkey-enum-fields.c.h" #include "libobs/obs-hotkey-identity-fields.c.h" diff --git a/libobs/obs-hotkey-background-state.c.h b/libobs/obs-hotkey-background-state.c.h new file mode 100644 index 0000000000..3edcf3fc09 --- /dev/null +++ b/libobs/obs-hotkey-background-state.c.h @@ -0,0 +1,19 @@ +#include "libobs/build/libobs.pch.h" + +/* Defined in obs-hotkey.c.h, later in the same unity group. */ +static inline bool lock(void); +static inline void unlock(void); + +enum obs_hotkeys_background_state obs_hotkeys_get_background_state(uint32_t *flags) +{ + if (flags) + *flags = 0; + if (!lock()) + return OBS_HOTKEYS_BACKGROUND_NATIVE; + + enum obs_hotkeys_background_state state = obs->hotkeys.background.state; + if (flags) + *flags = obs->hotkeys.background.flags; + unlock(); + return state; +} diff --git a/libobs/obs-hotkey.c.h b/libobs/obs-hotkey.c.h index 1ad9226ed3..9b73669900 100644 --- a/libobs/obs-hotkey.c.h +++ b/libobs/obs-hotkey.c.h @@ -475,20 +475,6 @@ void obs_hotkeys_background_status_changed(void) signal_handler_signal(obs->hotkeys.signals, "hotkey_background_status_changed", NULL); } -enum obs_hotkeys_background_state obs_hotkeys_get_background_state(uint32_t *flags) -{ - if (flags) - *flags = 0; - if (!lock()) - return OBS_HOTKEYS_BACKGROUND_NATIVE; - - enum obs_hotkeys_background_state state = obs->hotkeys.background.state; - if (flags) - *flags = obs->hotkeys.background.flags; - unlock(); - return state; -} - char *obs_hotkey_combination_get_background_id(obs_key_combination_t combo) { if (!lock()) diff --git a/rust/obs-build/tests/native/registration/headless_characterizations_expected.json b/rust/obs-build/tests/native/registration/headless_characterizations_expected.json index 52cfb3bef3..7678262dd7 100644 --- a/rust/obs-build/tests/native/registration/headless_characterizations_expected.json +++ b/rust/obs-build/tests/native/registration/headless_characterizations_expected.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -74,6 +75,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/portal_output_expected.json b/rust/obs-build/tests/native/registration/portal_output_expected.json index f8739454cf..939027a17b 100644 --- a/rust/obs-build/tests/native/registration/portal_output_expected.json +++ b/rust/obs-build/tests/native/registration/portal_output_expected.json @@ -86,6 +86,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -158,6 +159,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_enum.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_enum.json index f8fba99b4b..e04204e27f 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_enum.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_enum.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -59,6 +60,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_press.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_press.json index 32662e5f4c..ca7835ce9f 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_press.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_press.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -59,6 +60,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_trigger.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_trigger.json index a4655ccb99..b1082cd601 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_trigger.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_background_trigger.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -59,6 +60,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_binding_press_steps.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_binding_press_steps.json index 219db6f27f..a277a863e3 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_binding_press_steps.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_binding_press_steps.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -57,6 +58,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_getters_characterization.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_getters_characterization.json index 9b9bde4b4f..eb5d068c01 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_getters_characterization.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_getters_characterization.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -55,6 +56,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_load.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_load.json index fa61c91145..d3c28d9896 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_load.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_load.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -54,6 +55,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_pair_steps.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_pair_steps.json index 51e20dc06a..9fb3c2acad 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_pair_steps.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_pair_steps.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -57,6 +58,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_press_steps.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_press_steps.json index 7837fef54f..a5bd7e5e08 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_press_steps.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_press_steps.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -57,6 +58,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_unregister_entry.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_unregister_entry.json index 6ef5c72a38..d0069da039 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_unregister_entry.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_hotkey_unregister_entry.json @@ -8,6 +8,7 @@ "libobs/obs-hotkey-background-query.c.h", "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -56,6 +57,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister_entry": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_portal_shortcuts.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_portal_shortcuts.json index 0ac19ed317..4151c47d38 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_portal_shortcuts.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_portal_shortcuts.json @@ -13,6 +13,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -79,6 +80,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_wayland_hotkeys.json b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_wayland_hotkeys.json index a532206a74..4130bec955 100644 --- a/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_wayland_hotkeys.json +++ b/rust/obs-build/tests/native/registration/rust-static/cases/hotkey-control/test_wayland_hotkeys.json @@ -9,6 +9,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -68,6 +69,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ diff --git a/test/cmocka/build/test-graph.json b/test/cmocka/build/test-graph.json index 45d4bbce0e..15f5ce1597 100644 --- a/test/cmocka/build/test-graph.json +++ b/test/cmocka/build/test-graph.json @@ -5855,6 +5855,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -5905,6 +5906,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6004,6 +6006,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -6054,6 +6057,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6156,6 +6160,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -6206,6 +6211,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6351,6 +6357,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -6405,6 +6412,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6535,6 +6543,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -6586,6 +6595,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6704,6 +6714,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -6754,6 +6765,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6879,6 +6891,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -6933,6 +6946,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -6998,6 +7012,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -7052,6 +7067,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -7131,6 +7147,7 @@ "libobs/obs-hotkey-background-query.c.h", "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -7184,6 +7201,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister_entry": [ @@ -11968,6 +11986,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -12040,6 +12059,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [ @@ -20845,6 +20865,7 @@ "libobs/obs-hotkey-register.c.h", "libobs/obs-hotkey-background-control-fields.c.h", "libobs/obs-hotkey-unregister.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h", "libobs/obs-hotkey-unregister-entry-fields.c.h", "libobs/obs-hotkey-inject-entry-fields.c.h", @@ -20910,6 +20931,7 @@ ], "hotkey_registration": [ "libobs/obs-hotkey-register.c.h", + "libobs/obs-hotkey-background-state.c.h", "libobs/obs-hotkey.c.h" ], "hotkey_unregister": [