Repository navigation
Description
Part of #847.
Inventory of platform conditionals in frontend/widgets/OBSBasic_*.cpp measured on origin/master. Total: 33.
Conditionals
| File | Line | Macro | What the branch does |
|---|---|---|---|
OBSBasic_Dropfiles.cpp |
26 | _WIN32 |
include QSettings |
OBSBasic_Dropfiles.cpp |
36 | _WIN32 |
add "jxr" to image extensions |
OBSBasic_Dropfiles.cpp |
76 | _WIN32 |
ReadWindowsURLFile (.url shortcut parser) |
OBSBasic_Dropfiles.cpp |
138 | _WIN32 |
text source id text_gdiplus (else text_ft2_source) |
OBSBasic_Dropfiles.cpp |
145 | _WIN32 |
text source read_from_file settings |
OBSBasic_Dropfiles.cpp |
289 | _WIN32 |
handle dropped .url files |
OBSBasic_Hotkeys.cpp |
46 | _WIN32 |
hotkey meta string Hotkeys.Windows vs other |
OBSBasic_MainControls.cpp |
35 | __APPLE__ |
include OBSPermissions.hpp |
OBSBasic_MainControls.cpp |
40 | _WIN32 |
include AutoUpdateThread.hpp |
OBSBasic_MainControls.cpp |
44 | _WIN32 or WHATSNEW_ENABLED |
include WhatsNewInfoThread.hpp |
OBSBasic_MainControls.cpp |
238 | __APPLE__ |
show OBSPermissions dialog |
OBSBasic_MainControls.cpp |
380 | _WIN32 |
disable CheckForUpdates / Repair actions |
OBSBasic_MainControls.cpp |
486 | !_WIN32 |
close dialogs before always-on-top toggle |
OBSBasic_MainControls.cpp |
582 | __APPLE__ |
EnableOSXDockIcon(false) |
OBSBasic_MainControls.cpp |
596 | __APPLE__ |
EnableOSXDockIcon(true) |
OBSBasic_Preview.cpp |
537 | __linux__ |
DontUseNativeDialog for colour dialog |
OBSBasic_Profiles.cpp |
992 | !__APPLE__ |
CheckNVENCInternal helper |
OBSBasic_Profiles.cpp |
1016 | _WIN32 |
obs-nvenc-test.exe vs obs-nvenc-test |
OBSBasic_Profiles.cpp |
1159 | !__APPLE__ |
NVENC check branch |
OBSBasic_Projectors.cpp |
114 | __APPLE__ or _WIN32 |
screen name label vs fallback label |
OBSBasic_Recording.cpp |
316 | __APPLE__ |
paused tray icon (mac mask) |
OBSBasic_Recording.cpp |
351 | __APPLE__ |
active tray icon (mac mask) |
OBSBasic_SceneItems.cpp |
96 | __APPLE__ |
prefer SCK audio capture source id on macOS 13+ |
OBSBasic_SysTray.cpp |
26 | __APPLE__ |
tray icon file (mac mask) |
OBSBasic_SysTray.cpp |
91 | __APPLE__ |
tray activation reason ignored |
OBSBasic_SysTray.cpp |
131 | __APPLE__ |
EnableOSXDockIcon(false) |
OBSBasic_Updater.cpp |
24 | _WIN32 |
include AutoUpdateThread.hpp |
OBSBasic_Updater.cpp |
31 | _WIN32 or WHATSNEW_ENABLED |
include WhatsNew headers |
OBSBasic_Updater.cpp |
41 | _WIN32 |
UPDATE_CHECK_INTERVAL 4 days |
OBSBasic_Updater.cpp |
86 | _WIN32 |
whatsnew platforms.windows filter |
OBSBasic_Updater.cpp |
90 | __APPLE__ (elif) |
whatsnew platforms.macos filter |
OBSBasic_Updater.cpp |
185 | _WIN32 (elif) |
last update check logic |
OBSBasic_Updater.cpp |
205 | _WIN32 |
disable CheckForUpdates / Repair actions |
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_tray_icon(TrayState), platform_set_dock_icon_visible(bool), platform_tray_activation_ignored() |
osx: masks, dock icon; others default (shared with OBSBasic.hpp, see sibling issue) |
platform_check_nvenc(missing_encoders), platform_nvenc_test_binary_name() |
windows: .exe; x11: bare name; osx: unavailable |
platform_text_source_id() and platform_text_source_settings(...) |
windows: text_gdiplus/read_from_file; others text_ft2_source |
platform_extra_image_extensions(), platform_resolve_dropped_shortcut(file) |
windows: jxr, .url parsing (ReadWindowsURLFile moves to platform-windows.cpp) |
platform_check_permissions_dialog(parent) |
osx |
platform_updater_enabled(), platform_update_check_interval(), platform_whatsnew_platform_flag(platforms), platform_disable_updater_actions(ui) |
windows / osx |
platform_color_dialog_options(), platform_hotkey_meta_string(), platform_projector_screen_label(screen), platform_prefer_sck_audio_capture() |
per platform |
Likely must stay / caveats
- Include-only conditionals (35/40/44, 24/31) move into platform impl files with the corresponding function.
WHATSNEW_ENABLEDis a feature flag and stays.
Test approach
Characterisation tests for platform_nvenc_test_binary_name, platform_update_check_interval, ReadWindowsURLFile (parse a .url fixture; Windows-only test) and the whatsnew platform filter; the rest by 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
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 24, 2026
Claiming: #873, one PR per widget file. First is
OBSBasic_Dropfiles(5 conditionals, plus the_WIN32QSettings include infrontend-widgets.pch.hpp). Four new facade calls:IsPlatformImageExtension,GetPlatformTextSourceId,SetPlatformTextFileSettingsandResolvePlatformDroppedFile.frontend: dropped files through the platform facade (obs-rust#873) (o…
frontend: small main window quirks through the platform facade (obs-r…
test(ci): the NVENC check goes through the platform facade (#873)
frontend: the NVENC check through the platform facade (#873)
frontend: the tray icon through the platform facade (obs-rust#873) (o…
test(ci): main window controls go through the platform facade (#873)
frontend: main window controls through the platform facade (#873)
test(ci): the updater goes through the platform facade (#873)
frontend: the updater through the platform facade (#873)
frontend: the NVENC check through the platform facade (obs-rust#873) (o…
frontend: main window controls through the platform facade (obs-rust#873
test(ci): the updater goes through the platform facade (#873)
frontend: the updater through the platform facade (#873)
frontend: the updater through the platform facade (obs-rust#873) (obs…
zackees commentedon Oct 25, 2026
/ready
Triage: a complete inventory (33 conditionals with lines and what each one does), one PR per widget file, claimed and started with
OBSBasic_Dropfiles. Acceptance: every listed conditional is behindfrontend/utility/platform.hppandci/platform_ifdef_ratchet.pydrops each file from its baseline. P3, size:L (split per file as planned).zackees commentedon Oct 26, 2026
Done on master. The per-file PRs merged: #2019 (dropped files), #2020, #2025, #2029, #2037 and #2039. No
#ifon_WIN32,__APPLE__or__linux__is left infrontend/widgets/OBSBasic_*. The only files infrontend/widgets/that still have one are the OS-namedobsbasic-windows.hpp,obsbasic-linux.hppandobsbasic-macos.hpp.ci/platform-ifdef-baseline.jsonno longer lists any OBSBasic file.