Skip to content

frontend: Keep the Settings audio track buttons by their label - #1136

Merged
zackees merged 4 commits into
obs-rust:masterfrom
rdoupe:fix/settings-audio-track-radios
Oct 17, 2026
Merged

zackees merged 4 commits into
obs-rust:masterfrom
rdoupe:fix/settings-audio-track-radios

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1135

What and why

In a tall Settings window, the audio track buttons on Settings > Output now stay next to their "Audio Track" label. Before, they slid down the page, further the taller the window (upstream obsproject/obs-studio#13286, reported by Tre-Kronor and reproduced by suogesi).

Cause

  • Each track row in frontend/forms/OBSBasicSettings.ui is a QStackedWidget (single-track radio buttons or multi-track checkboxes) next to a QLabel in a form layout, with vsizetype="Preferred".
  • The Output page sits in a scroll area that fills the window. When the window is taller than the page needs, the spare height goes to those stacks. The buttons are centred in the taller stack, and the label stays at the top of the row.
  • Three rows have it: advStreamTrackWidget (Advanced > Streaming), advRecTrackWidget (Advanced > Recording) and simpleRecTrackWidget (Simple mode recording).

Fix

  • suogesi's upstream fix, fix: Supress a Settings UI Streching obsproject/obs-studio#13357 (open upstream), ported with suogesi as the commit author: advStreamTrackWidget gets vsizetype="Fixed".
  • A second commit does the same for advRecTrackWidget and simpleRecTrackWidget, which the upstream PR doesn't cover.
  • A Fixed policy keeps each stack at its size hint, the height of its tallest page, so the multi-track checkbox page still fits.

In the release and on this branch (headless, private Xvfb at 1920x2160, fresh profile; a small test plugin opened Settings > Output, resized the window and logged each widget's position). The distance from the centre of the first track button to the centre of its label:

Row Window height 0.1.0-beta.20261014 this branch (C lane build)
Advanced > Streaming 700 / 1000 px 0 px 0 px
Advanced > Streaming 1400 px 90 px 0 px
Advanced > Streaming 2000 px 190 px (stack 413 px tall) 0 px (stack 22 px)
Advanced > Recording 2000 px 269 px 0 px
Simple > Recording 2000 px 163 px 0 px

The screenshots match: in the release the label sits at the top of the row with buttons 1 to 6 far below it; on this branch they are on one line, and the rows below follow straight after.

RED → GREEN

  • RED commit: f540685 test/cmocka: Settings audio track buttons slide away from their label. test_settings_track_rows builds the real OBSBasicSettings.ui with uic. Its five custom widgets (OBS::SpinBox, OBS::DoubleSpinBox, AbsoluteSlider, OBSHotkeyEdit, UrlPushButton) are replaced by plain Qt stand-ins in test/cmocka/settings-ui-stubs/. It shows the Output page at 700, 1400 and 2000 px on Qt's offscreen platform. Each case checks that the first track button's centre stays within 3 px of its label's. 3 of 3 cases fail in both lanes:
    • advanced_streaming_track_stays_by_label: 385 px at 2000 px;
    • advanced_recording_tracks_stay_by_label: 279 px;
    • simple_recording_tracks_stay_by_label: 254 px.
  • c08439d (suogesi's commit): the streaming case passes; the two recording cases still fail.
  • GREEN: 4824327. 3/3 with ENABLE_RUST_LIBOBS OFF and ON. The stacks stay at 19 px and the buttons level with their labels at every height.
  • Full ctest at -j8 (private Xvfb and D-Bus, system libobs-opengl masked, TMPDIR unset):
    • C lane: 274/274, test_settings_track_rows included. Skips as on master: open_crashes_without_obs_core (test_audio_io, test_video_io) and test_startup_cycle_stress (obs_startup under the nested Xvfb). All PipeWire/Pulse tests ran.
    • Rust lane: 274/274, same skips.
  • clang-format 22.1.3, gersemi and ci/test_registration.py are clean.
  • The new test needs only Qt Widgets: no display (it passes with DISPLAY unset), no frontend build, no libobs. It is registered for every platform with cmocka_qt_runtime(). It runs uic by hand (qt_wrap_ui), like test_plugin_manager.
  • The release measurement again on this branch's build (C lane, with the frontend): the table above.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): none
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): not a Rust port. The upstream fix is ported unchanged (suogesi is the commit author); the recording rows are an addition.

AI note: Claude Code (Claude Opus 5.5) wrote the test, the second commit, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines. The first fix commit is suogesi's.

🤖 Generated with Claude Code

@rdoupe
rdoupe requested a review from zackees as a code owner October 16, 2026 23:32
@zackees
zackees force-pushed the fix/settings-audio-track-radios branch from 4824327 to 745de54 Compare October 17, 2026 00:11
@rdoupe
rdoupe force-pushed the fix/settings-audio-track-radios branch from 745de54 to f5d0ef0 Compare October 17, 2026 00:15
@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

The macOS Tier 2 failure was in the new test: its assert_in_range calls are deprecated in the Homebrew cmocka (2.x), and the build uses -Werror. CI's Ubuntu cmocka (1.x) has no assert_int_in_range, so the test now does the range check itself with fail_msg, which builds on both. I amended the test commit on top of your rebase onto #1139. The other two commits are unchanged.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

CI triage (maintainer loop): Rust Tier 2 windows-2025-vs2026 hung on this PR's new test. The log ends at Start 117: test_settings_track_rows, with every earlier test passed, and the job sat in "Validate Tier 2 on Windows" for 32 minutes; the last six runs of that job took about 6. I cancelled run 38985492751, so it shows red now.

Probable cause: this is the first Qt GUI test that actually runs in the Windows Tier 2 lane. The other offscreen tests (test_hotkey_edit_backtab, test_output_timer) also need Qt Test, which isn't found there, so they never appear in the Windows ctest list. cmocka_qt_runtime() only puts Qt's bin directory on PATH. If QT_QPA_PLATFORM=offscreen can't load platforms/qoffscreen.dll from there, Qt on Windows shows a modal "no Qt platform plugin could be initialized" message box, which blocks forever on a headless runner instead of failing.

Suggestions:

  • On Windows, set QT_QPA_PLATFORM_PLUGIN_PATH (or QT_PLUGIN_PATH) in the test's environment to the Qt install's plugins directory. It could go in cmocka_qt_runtime(), so later Qt GUI tests get it too.
  • Give the test a ctest TIMEOUT (e.g. 120 s) so a hang fails quickly with a log instead of using up the job.
  • Or, if the layout check doesn't matter on Windows, skip the test there, with a comment explaining why.

Push a fix and CI will re-run.

rdoupe and others added 4 commits October 16, 2026 23:07
cmocka_qt_runtime() puts Qt's bin directory on PATH for Windows tests
so they find the Qt DLLs, but a Qt GUI test also loads plugins, such
as its platform plugin. Also put the Qt prefix's plugins directory, next
to bin as find_qt_plugins() expects, on QT_PLUGIN_PATH, so a test finds
Qt's plugins even when Qt cannot work out its own install prefix.

The obs-deps Qt is relocatable and finds its plugins from Qt6Core.dll,
so this changes nothing for today's tests. It is there for the Qt GUI
tests that run in the Windows Tier 2 lane from the next commit on.

Refs obs-rust#1135.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In a tall Settings window the Audio Track buttons on Settings > Output
move down, away from their "Audio Track" label. Each track row is a
QStackedWidget next to a label in a form layout. Its vertical size
policy is Preferred, so the page's spare height goes to the stack, the
buttons are centred in it, and the label stays at the top of the row.
In the 0.1.0-beta.20261014 release, in a 2000 px tall window, the
buttons sit 190 px below the label on Advanced > Streaming, 269 px on
Advanced > Recording and 163 px for the Simple mode recording tracks.

test_settings_track_rows builds the real OBSBasicSettings.ui with uic,
with plain Qt stand-ins for its five custom widgets
(settings-ui-stubs/), and shows the Output page at 700, 1400 and 2000 px
on Qt's offscreen platform. Each case checks that the first track
button's centre stays within 3 px of its label's centre.

On Windows the test uses Qt's minimal platform instead: Qt builds the
offscreen one only with FreeType, and the obs-deps Qt for Windows has
none, so it ships no qoffscreen.dll. A release Qt that loads no platform
plugin in a process without a console window, as under ctest on a CI
runner, shows a modal message box and waits, so the test first looks
for the plugin where Qt does and fails on stderr if it is missing. A
ctest TIMEOUT of 120 s covers any other hang.

RED: 3 of 3 cases fail. The buttons are 385 px (Advanced > Streaming),
279 px (Advanced > Recording) and 254 px (Simple) from the label at
2000 px.

Refs obs-rust#1135.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
change `advStreamTrackWidget`'s vsizetype from `Preferred` to `Fixed`
which prevent this item stretching in vertical direction

Ported from obsproject/obs-studio#13357 (upstream issue
obsproject/obs-studio#13286). test_settings_track_rows:
advanced_streaming_track_stays_by_label now passes.

Refs obs-rust#1135.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The recording track rows have the same layout as the streaming one:
advRecTrackWidget (Advanced > Recording) and simpleRecTrackWidget
(Simple mode) are QStackedWidgets with a vertical size policy of
Preferred, so in a tall Settings window they take the page's spare
height and their track checkboxes slide away from the "Audio Track"
label (269 px and 163 px at 2000 px in 0.1.0-beta.20261014). Give them
a Fixed vertical policy too, as the previous commit does for
advStreamTrackWidget.

test_settings_track_rows: 3/3. In each row the first track button stays
level with its label at 700, 1400 and 2000 px.

Fixes obs-rust#1135.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdoupe
rdoupe force-pushed the fix/settings-audio-track-radios branch from f5d0ef0 to d749a11 Compare October 17, 2026 06:19
@rdoupe

rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the triage. You were right about the cause, but it isn't the plugin path. The obs-deps Qt for Windows has no qoffscreen.dll at all. Its plugins/platforms/ holds only qdirect2d, qminimal and qwindows. Qt builds the offscreen platform only with FreeType (if(QT_FEATURE_freetype AND NOT WASM) in qtbase's src/plugins/platforms/CMakeLists.txt), and deps.qt/qt6.ps1 sets FEATURE_freetype=OFF. So QT_QPA_PLATFORM=offscreen could never load on Windows, whatever the path.

The hang comes from qtbase 6.11.1 init_platform(): when no platform plugin loads, a release Qt calls MessageBox() before qFatal() if GetConsoleWindow() is null. Under ctest on a runner that's the case, so it waits for a click. SetErrorMode() and WER settings don't help, because this is a plain MessageBox call, not a crash dialog.

Changes (one new commit, and the test commit amended; the two fix commits are unchanged):

  • test/cmocka: Give Windows Qt tests Qt's plugins directory: cmocka_qt_runtime() now also puts <Qt prefix>/plugins on QT_PLUGIN_PATH on Windows. It's derived from Qt6Core.dll the same way find_qt_plugins() does it (bin/../plugins). This is a safety net only: the obs-deps Qt is relocatable and already finds its plugins from Qt6Core.dll.
  • The test commit:
    • On Windows the test uses QT_QPA_PLATFORM=minimal:enable_fonts (offscreen everywhere else).
    • Before it creates the QApplication, it checks that the platform plugin exists where Qt looks for it (QT_QPA_PLATFORM_PLUGIN_PATH, then each library path's platforms/). If the plugin is missing, the test prints the paths it searched to stderr and exits 1, so Qt never reaches the message box.
    • The test now has TIMEOUT 120.

What I verified, on Linux only:

  • Both lanes (C and Rust libobs): test_settings_track_rows passes 3/3 on the fix commits and fails 3/3 on the test commit.
  • I built the Windows code path on Linux, using the .so name, to check it:
    • It loads minimal (confirmed by printing platformName()).
    • On the minimal platform it still fails 3/3 before the fix (355/217/186 px) and passes 3/3 after it.
    • With a missing plugin it prints the searched paths and exits 1.
  • ctest reports the 120 s TIMEOUT. Full ctest -j8 in the C lane: 275/275.
  • clang-format 22.1.3, gersemi and ci/test_registration.py are clean.

Not verified: I have no Windows machine, so the Windows Tier 2 run on this push is the first real test of the minimal platform with the obs-deps Qt there. If that isn't wanted, the fallback is to register the test only where offscreen exists (not Windows).

@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Merged via the queue into obs-rust:master with commit 0f58b0e Oct 17, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: frontend: Settings > Output audio track buttons slide away from their "Audio Track" label in a tall window (upstream #13286)

3 participants