Repository navigation
Description
Unit
Port the pure decisions of libobs/util/windows/window-helpers.c.h to rust/obs-util, as a new module window_match, next to platform_windows and dstr. On Windows they decide which windows the window and game capture property lists show, and which window a capture source reattaches to when its window reopens:
is_microsoft_internal_window_exe(210-226), with its tablesinternal_microsoft_exes_exact(185-202) andinternal_microsoft_exes_partial(205-208): 15 exact names compared case-insensitively, and the prefixwindowsinternal;- the skip filter in
add_window(236-248): an internal exe is skipped, and so isexplorer.exewith an empty title (a case-sensitive compare, unlike the list above); - the score in
window_rating(431-455): the generic-class demotion, the UWP title-only match, and the class, title and exe priorities, with0x7FFFFFFFas "no match" and the0x1000exe penalty under the class priority; is_generic_class(464-481): a case-insensitive substring search forChromeorSDL_app;is_uwp_class(483-487): an exact compare withWindows.UI.Core.CoreWindoworWinUIDesktopWin32WindowClass.
These stay in C: ms_get_window_exe, ms_get_window_title and ms_get_window_class and every call to them (the reads in window_rating and add_window stay where they are), the three dstr_cmpi compares of window_rating, check_window_valid, IsWindowCloaked, ms_is_uwp_window, ms_get_uwp_actual_window, first_window, next_window, ms_fill_window_list, EnumWindows and enum_windows_proc's stop rule, the best-so-far compares in ms_find_window and enum_windows_proc, the callback, the string building and obs_property_list_add_string in add_window, every dstr_free, ms_build_window_strings and ms_check_window_property_setting.
Phase and position
Phase 6, Windows host code in the windows+ unity group, beside the WASAPI monitor delay port (#3105). Tracking: #4.
Dependencies and existing tests
- No dependency; no open PR touches
window-helpers.c.hor thewindows+group. - Real libobs: no test reaches these functions; they build only on Windows.
- No characterization:
test_window_match_stepslands first in the same PR. The moved file includes no Windows header, so it builds and runs on every OS.
Notes
One PR, separate commits: the behaviour-neutral move into libobs/util/windows/window-match.c.h (hidden functions over C strings, bools and ints; the three compares stay in window_rating, which passes their results), characterization, RED, GREEN (group libobs.ported-window-match), Tier 3 (exhaustive over the priorities, the flags and title distances; every internal name in each case pattern; the class substrings at every offset and case, with non-ASCII bytes), docs.
No intentional difference is expected. astrcmpi, astrcmpi_n and astrstri fold with tolower per byte; the Rust folds ASCII only, which is the same in the C locale libobs runs in, and Tier 3 runs over every byte value to show it.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 31, 2026
Claiming: the window match rating and window list filters port.
Plan, one PR:
add_window's skip test andwindow_rating's score chain intolibobs/util/windows/window-match.c.has hidden functions;window_ratingkeeps its three reads and three compares.test_window_match_steps(cmocka, every OS).obs_util::window_matchTier 1 againsttodo!().src/ffi/window_match.rs, inlibobs.ported-window-match.Draft PR with the RED commit expected within a few hours.
libobs: Move the window match decisions
test: Characterize the window match decisions
obs-util: Test the window match port
obs-util: Port the window match decisions
obs-util: Compare window match to C
docs: Record the window match port
libobs: Move the window match decisions
test: Characterize the window match decisions
obs-util: Test the window match port
obs-util: Port the window match decisions
obs-util: Compare window match to C
docs: Record the window match port
rdoupe commentedon Oct 31, 2026
Fixed by the pull request that ports the window match decisions (PR #3156), merged through the merge queue. The pure decisions of
libobs/util/windows/window-helpers.c.h(which windows the window and game capture lists hide, and how well a window matches a capture source's saved window) now run inobs_util::window_match, with all four test tiers and no change in behaviour.What is left: nothing of this unit. The window reads, the three
dstr_cmpicompares,check_window_valid, the window enumeration and the list building stay in C by design, as the issue lists. Two behaviours are characterized, not endorsed:Explorer.exe(any case but lower) with an empty title is listed, and a priority outside the three matches nothing but a UWP window by its exact title.Follow-up issue: none; there is no remainder to port.
obs-util: Port the window match decisions (obs-rust#3156)