Skip to content

facade: frontend/widgets: OBSBasicPreview, OBSBasicStats, OBSProjector, OBSQTDisplay: move 14 platform conditionals behind frontend/utility/platform.hpp #875

Closed

Description

@zackees

Part of #847.

Inventory of platform conditionals in frontend/widgets: OBSBasicPreview, OBSBasicStats, OBSProjector, OBSQTDisplay measured on origin/master. Total: 14.

Conditionals

File Line Macro What the branch does
OBSBasicPreview.cpp 2500 _WIN32 default font face Arial
OBSBasicPreview.cpp 2502 __APPLE__ (elif) default font face Helvetica
OBSBasicPreview.cpp 2513 _WIN32 text outline settings for GDI+ text
OBSBasicStats.cpp 175 !__APPLE__ setWindowIcon from theme
OBSProjector.cpp 40 __linux__ or __FreeBSD__ or __DragonFly__ disable WA_PaintOnScreen (projector resize workaround)
OBSProjector.cpp 46 !__APPLE__ setWindowIcon from theme
OBSQTDisplay.cpp 6 !_WIN32 && !__APPLE__ include obs-nix-platform.h
OBSQTDisplay.cpp 11 ENABLE_WAYLAND include QApplication
OBSQTDisplay.cpp 15 _WIN32 include windows.h
OBSQTDisplay.cpp 40 _WIN32 gswindow.hwnd
OBSQTDisplay.cpp 42 __APPLE__ (elif) gswindow.view
OBSQTDisplay.cpp 50 ENABLE_WAYLAND Wayland display handle
OBSQTDisplay.cpp 76 !_WIN32 && !__APPLE__ null X11/Wayland display after destroy
OBSQTDisplay.cpp 170 _WIN32 nativeEvent WM_ message handling

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_default_text_font() / platform_text_source_id() / platform_apply_text_outline(settings) windows Arial + gdiplus outline; osx Helvetica; x11 default font (shared with components/Multiview and dialogs/OBSBasicProperties)
platform_set_window_icon(QWidget*) osx no-op; others themed icon
platform_projector_window_setup(QWidget*) x11/bsd attribute
platform_fill_gs_window(gs_window&, QWindow*), platform_release_gs_window(gs_window&), platform_display_native_event(...) windows: hwnd/MSG; osx: view; x11: X11/Wayland display (ENABLE_WAYLAND stays inside platform-x11.cpp)

Likely must stay / caveats

  • None: all can move; OBSQTDisplay is the most delicate (display-handle ownership), keep the move mechanical.

Test approach

Characterisation test for the font/text-source facade values; display-handle wiring covered by native builds (ci-full) and the X11/Wayland smoke in the AppImage test.

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.

Activity

  1. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Claiming: remaining widget platform facade. 1. Characterize original text/window policy, graphics-window mapping, hidden-display reset and native-event handling in RED. 2. Move the host decisions into the existing frontend platform implementations, preserving handle ownership and native-event return semantics. 3. Run real Qt checks, native app builds and the applicable X11/Wayland smoke checks, then normal merge queue. First draft PR today.

  2. added
    claimed
    on Oct 21, 2026
  3. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Fixed by #1635 (merge 8100ce0). All listed shared widget host decisions and display PCH SDK branches now use the native platform facade; ratchet drops 13 findings. Original policy/OBSPtr ownership characterization, ARC no-retain/no-release compilation, live X11 and Wayland QWindow handle/hidden-display smoke, all 19 existing Qt tests, required full Windows/macOS/Linux app builds, PR CI and merge-result CI 39653056106 passed. No public C headers or existing C test code changed. The extra full workflow is still observing its final macOS Tier 2 job; no complete full-run success is claimed yet. No remaining facade work.

  4. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Final validation update: full workflow 39651098215 also completed successfully, including the final macOS Tier 2 job, all native app architectures, live X11/Wayland smoke, compatibility suites and Flatpak. Merge-result CI 39653056106 passed. Final audit verifies this is the tenth merged/closed issue in the sequential batch; no validation work remains.

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