Repository navigation
Description
Part of #847.
Inventory of platform conditionals in frontend/settings/OBSBasicSettings.cpp measured on origin/master. Total: 29.
Conditionals
| Line | Macro | What the branch does |
|---|---|---|
| 594 | _WIN32 |
connect disableAudioDucking widget signals |
| 597 | _WIN32 or __APPLE__ or __linux__ |
connect browserHWAccel widget signals |
| 635 | !_WIN32 && !ENABLE_SPARKLE_UPDATER |
delete the Updates group box |
| 656 | _WIN32 |
hide "hide OBS from capture" if SetDisplayAffinitySupported() is false |
| 678 | __APPLE__ && __aarch64__ |
delete adapter combo on Apple Silicon |
| 700 | !__APPLE__ && !__linux__ |
delete browser HW accel / sources group |
| 711 | !__APPLE__ && !__linux__ |
null the same widget pointers |
| 718 | !__APPLE__ |
delete disableOSXVSync / resetOSXVSync widgets |
| 1255 | _WIN32 or ENABLE_SPARKLE_UPDATER |
TranslateBranchInfo helper |
| 1272 | _WIN32 or ENABLE_SPARKLE_UPDATER |
load update branch list into combo |
| 1324 | _WIN32 or ENABLE_SPARKLE_UPDATER |
load EnableAutoUpdates |
| 1333 | _WIN32 |
load HideOBSWindowsFromCapture |
| 1475 | _WIN32 or (__APPLE__ && __aarch64__) |
populate renderer combo |
| 1477 | _WIN32 |
add Direct3D 11 renderer item |
| 2708 | __APPLE__ |
load DisableOSXVSync / ResetOSXVSyncOnExit |
| 2714 | _WIN32 (elif) |
load DisableAudioDucking |
| 2732 | _WIN32 or __APPLE__ or __linux__ |
load BrowserHWAccel |
| 3171 | _WIN32 or ENABLE_SPARKLE_UPDATER |
save EnableAutoUpdates / update branch |
| 3184 | _WIN32 |
save HideOBSWindowsFromCapture |
| 3267 | _WIN32 or __APPLE__ |
save projector monitor option (else ResetProjectors) |
| 3397 | _WIN32 or (__APPLE__ && __aarch64__) |
save renderer |
| 3404 | _WIN32 |
save process priority |
| 3414 | _WIN32 or __APPLE__ or __linux__ |
save BrowserHWAccel |
| 3424 | __APPLE__ |
save DisableOSXVSync |
| 3445 | _WIN32 |
save DisableAudioDucking |
| 4372 | __APPLE__ |
filename illegal-character regex (mac) |
| 4374 | _WIN32 (elif) |
filename illegal-character regex (windows) |
| 5753 | __APPLE__ |
enable/disable the OSX VSync reset checkbox |
| 5941 | _WIN32 |
show/hide process priority and related rows |
Proposed facade operations
Declared in frontend/utility/platform.hpp; implemented in frontend/utility/platform-windows.cpp, platform-osx.mm, platform-x11.cpp (Linux/BSD). Names are proposals; one facade function per logical operation, moves kept small and mechanical so upstream merges stay manageable.
| Facade function | Implementation |
|---|---|
platform_settings_capabilities() returning a struct {has_audio_ducking, has_browser_hw_accel, has_hide_from_capture, has_vsync_toggle, has_renderer_choice, has_process_priority, has_projector_monitor, has_updates_ui} |
each platform file fills its own; shared code branches at runtime on the fields, removing macros from the setup/load/save code |
platform_load_advanced_settings(config, ui) / platform_save_advanced_settings(...) |
windows: ducking, hide-from-capture, process priority, D3D11 renderer; osx: VSync, Apple Silicon renderer; x11: browser HW accel |
platform_filename_forbidden_chars() returning the regex string |
per platform |
platform_update_channel_supported() |
windows / osx |
Likely must stay / caveats
ENABLE_SPARKLE_UPDATERis a build feature macro (macOS updater), not a platform macro; it stays but should be expressed throughhas_updates_ui.__aarch64__combined with__APPLE__(678, 1475, 3397) is an arch check that moves into the capability struct.
Test approach
Characterisation tests for platform_filename_forbidden_chars and the capabilities struct (pure data); UI load/save paths are covered by native builds (ci-full).
RED first (failing characterisation test or facade stub), then GREEN, per docs/rust-port/testing-policy.md. Add the ci-full label since this touches shared frontend code built natively on all platforms.
Done when the listed files have no platform conditionals other than the documented exceptions, and the ratchet baseline (#848) is lowered accordingly.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 24, 2026
Claiming: #867 (frontend/settings/OBSBasicSettings.cpp.hpp, 29 baseline findings).
Plan, one PR per slice, following the self-guarded host headers from #865 (
settings-{windows,macos,linux}.hppincluded from the settings PCH, each defining feature macros or inline hooks that OBSBasicSettings tests instead of OS macros):First PR expected within a day.
test: Settings dialog host features on Linux (#867)
frontend: Settings dialog platform options behind host feature headers (
frontend: Settings dialog platform options behind host feature headers (
zackees commentedon Oct 24, 2026
Done in #2180. OBSBasicSettings.cpp.hpp now tests feature macros instead of platforms:
OBS_SETTINGS_WINDOWSOBS_SETTINGS_RENDEREROBS_SETTINGS_MACOS_VSYNCOBS_SETTINGS_BROWSER_HWACCELOBS_SETTINGS_PROJECTOR_ON_TOPOBS_SETTINGS_FILENAME_UNSAFEOBS_PLATFORM_HAS_UPDATE_BRANCHESThe self-guarded
frontend/settings/settings-{windows,macos,linux}.hppheaders in the settings PCH define them. The file's 29 findings have left the ratchet baseline, andtest_frontend_settings_hostpins the Linux feature set. Nothing is left for this issue.