Skip to content

frontend: Apply Show/Hide Transition to every selected source - #758

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/show-transition-multi
Oct 14, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/show-transition-multi

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Description

With several sources selected in the Sources list, picking a Show Transition or Hide Transition in the context menu, or changing its duration there, now applies to every selected source, not only the current one.

  • CreateVisibilityTransitionMenu() (frontend/widgets/OBSBasic_Transitions.cpp line 1041) changed GetCurrentSceneItem(), the current (top selected) item, in both the transition action (line 1063) and the duration box (line 1114). The other selected sources kept their old transition, while the menu, opened again on the same selection, showed the new one as picked. Paste in the same submenu (line 1171), Paste Filters and Paste Transform already act on every selected item.
  • The menu now calls visibility_transition_set() and visibility_transition_set_duration() (new, Qt-free, frontend/utility/visibility-transition.c). They apply the choice to the current item and to every other selected item of the scene, including selected items inside groups. Each item gets its own private transition named after its source ("Color 2 Show Transition"), with the default duration when it has none; an item that already has a transition of the picked type keeps it and its settings; None removes the transition and its duration, as before.
  • One undo entry covers every changed item ("Show Transition on 3 sources", two new en-US strings); with one changed item it reads as before ("Show Transition on 'Color 3'"). The undo data records each item's scene or group, so undo also reaches items inside groups.
  • The items are collected first and changed after the scene enumeration, because creating a transition source must not happen while the scene is locked.
  • The properties window of a configurable transition (Slide, Swipe, Stinger...) still opens once, for the current item.
  1. test/cmocka: Add failing test for Show/Hide Transition with several sources: adds test_visibility_transition and the helper as a stub with the current logic (the current item only). The test builds a scene of real libobs sources and a group, registers two minimal transition types, selects items and applies the menu choice. 6 of 8 cases fail: three items for Show Transition, Hide Transition, another type then None, undo/redo and the duration (1 of 3 changed each), and an item inside a group (unchanged). The two controls pass: one selected item gets the transition, named after its source, with the default duration; an item that already has a transition of the picked type keeps it.
  2. frontend: Apply Show/Hide Transition to every selected source: the fix. 8 of 8 pass.

Motivation and Context

Fixes #757 (upstream obsproject/obs-studio#10448, reported by BakaKuma-uwu on OBS 30.1.0, still open). Guffyf confirmed it on the issue, and OBS's Warchamp7 called it a known issue he would very much like fixed. An earlier upstream PR for the same thing by cg2121 (obsproject/obs-studio#6453) was closed as stale in September 2026; this is a separate implementation on the current frontend.

Why this one: a real user report with exact steps, confirmed by a second user and by the OBS UI maintainer, reproduced in our release; the change is contained in the frontend.

How Has This Been Tested?

Reproduced in the current release, AppImage v0.1.0-beta.20261014 (headless: private Xvfb, private HOME, dbus-run-session, --multi), with a small test module that adds three Color Sources, selects all three in the Sources list, opens the Sources context menu the way a right click does and picks Fade, then presses Undo and Redo. The same module against OBS built from this branch (Rust libobs lane, with the frontend):

Step Release This branch
Show Transition > Fade, three selected only the current item (Color 3) gets Fade, 300 ms all three get Fade, 300 ms
Hide Transition > Fade, three selected only Color 3 all three
Undo entry "Show Transition on 'Color 3'" "Show Transition on 3 sources"
One Undo Color 3 back to none all three back to none
Redo Color 3 Fade all three Fade

Automated, on master 0c45921, in both libobs lanes (ENABLE_RUST_LIBOBS OFF and ON):

  • test_visibility_transition: 6 of 8 fail at the RED commit, 8 of 8 pass at GREEN, in both lanes. ctest -V shows all 8 cases run under Xvfb. It loads the built OpenGL module (GRAPHICS_MODULE_PATH), because transitions need graphics; without a display all 8 cases skip (obs_startup() fails), like the other transition tests, so it builds but skips in CI.
  • Full ctest at GREEN under a private Xvfb with software GL and the system libobs-opengl masked, TMPDIR unset: 213 of 213 (C lane) and 213 of 213 (Rust lane). Every PipeWire and PulseAudio test ran. Skipped cases: open_crashes_without_obs_core (two tests) and test_startup_shutdown_cycles. These skip on master here as well (the two startup stress tests skip as soon as one obs_startup() in their loop fails).
  • clang-format, gersemi and ci/test_registration.py are clean.

Not tested:

  • Configurable transitions: each selected item gets its own transition with default settings, and the properties window opens for the current item's transition only, as it did before for the one item. Settings changed there are not copied to the other items.
  • Studio Mode: the menu uses the scene shown in the Sources list (GetCurrentScene()), the same as Paste Filters; not driven end to end here.
  • Scale Filtering, Blending Mode and Blending Method in the same context menu have the same one-item behaviour (mentioned on the upstream issue). They are left for a separate change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, the test, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@rdoupe
rdoupe requested a review from zackees as a code owner October 14, 2026 19:01
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 14, 2026
rdoupe and others added 2 commits October 14, 2026 12:49
…ources

With several sources selected in the Sources list, picking a Show
Transition or Hide Transition (or its duration) in the context menu
changes one of them only. OBSBasic::CreateVisibilityTransitionMenu()
(frontend/widgets/OBSBasic_Transitions.cpp) changes GetCurrentSceneItem(),
the current item, and ignores the rest of the selection, although Paste
in the same submenu, Paste Filters and Paste Transform act on every
selected item.

visibility_transition_set(), visibility_transition_restore() and
visibility_transition_set_duration() in
frontend/utility/visibility-transition.c are the Qt-free menu actions
and undo/redo the frontend will call. The stub has the current logic: it
changes the item the menu is for only. The test builds a scene of real
libobs sources and a group, registers two minimal transition types,
selects items and applies the menu choice:

  three items, Show Transition:              1 of 3 changed
  three items, Hide Transition:              1 of 3 changed
  an item and an item inside a group:        the group child unchanged
  three items, another type, then None:      1 of 3 changed
  three items, undo and redo:                redo covers 1 of 3
  three items, duration:                     1 of 3 changed

6 of 8 cases fail. The controls pass: one selected item gets the
transition (named after its source, with the default duration), and an
item that already has a transition of the picked type keeps it.

Refs obs-rust#757.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With several sources selected in the Sources list, picking a Show
Transition or Hide Transition in the context menu, or changing its
duration there, changed only the current item. The other selected items
kept their old transition, while the menu, opened again on the same
selection, showed the new one as picked.

The menu now goes through visibility_transition_set() and
visibility_transition_set_duration(), which apply the choice to the
current item and to every other selected item, including selected items
inside groups, like Paste in the same submenu already does. Each item
gets its own private transition named after its source, and an item
that already has a transition of the picked type keeps it and its
settings. One undo entry covers every changed item ("Show Transition on
3 sources"); with one changed item it reads as before. The properties
window of a configurable transition still opens for the current item
only.

Fixes obs-rust#757.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=95d787886f73ebd85483edbc1a021b2f8554ea49 secs=485 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792007872,"gate":"rust/all/fmt","host":"linux-x86_64","key":"6bb65c56c40332cbc0ed9d99446faa15d4af0309e30ba7168962d6a0709e596f","lane":"lint","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":53,"stamp":"f5296c81da47c978f1295d27add9fc98","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"6bb65c56c40332cbc0ed9d99446faa15d4af0309e30ba7168962d6a0709e596f","lane":"lint","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":53,"stamp":"7524ac87e3515cab0b62c71da1b72a13","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"2bae233c570194fd1871e99b69104f9ea1aa72653cbdc1fecf4c8302b499ed66","lane":"rust-test","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":122,"stamp":"64c33fcc214c5676520d0d4a06fdd6d2","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"5fad6e96f034af5febbc712dfd0386d54076941ba71e38add0fc8ddf2be4b8b9","lane":"cross","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":108,"stamp":"fa2efd1af6183e80d17bca0955f81fc1","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"5fad6e96f034af5febbc712dfd0386d54076941ba71e38add0fc8ddf2be4b8b9","lane":"cross","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":108,"stamp":"f1d045b2d4d6278b4aa415d1ad994dbe","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"5fad6e96f034af5febbc712dfd0386d54076941ba71e38add0fc8ddf2be4b8b9","lane":"cross","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":108,"stamp":"a94030cefcbd71123afe5d68c733c2d1","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"5fad6e96f034af5febbc712dfd0386d54076941ba71e38add0fc8ddf2be4b8b9","lane":"cross","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":108,"stamp":"0d94163e57c5dee14f48d784b3e56a0d","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"5fad6e96f034af5febbc712dfd0386d54076941ba71e38add0fc8ddf2be4b8b9","lane":"cross","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":108,"stamp":"7ee283c727f9eeb814db4706e684ad29","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"5fad6e96f034af5febbc712dfd0386d54076941ba71e38add0fc8ddf2be4b8b9","lane":"cross","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":108,"stamp":"ca02a0e30cb088c632fb4c39d5cc1566","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
Ci-Attestation: {"at":1792007872,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"bcdb4b4fc8e352e2572d86a5e0f9489b27ea6ecb5bb1e6092cecaba54759903f","lane":"tier2-linux","parents":["30c6cf5ebbd2fe2ba0851c9afdf9aa56a251dd0d"],"secs":202,"stamp":"6e49715186b9322dae049d7514814aec","tree":"95d787886f73ebd85483edbc1a021b2f8554ea49","v":1,"via":"run"}
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Rebased onto master, set ci-full (frontend change), and ran the stamped local gate. Your RED (6896d0877: 6 of 8 fail with the current-item-only stub) / GREEN (8 of 8) evidence above stands.

  • Rebased on master, local gate passed; pushed as 83adfea.

@zackees
zackees force-pushed the fix/show-transition-multi branch from 3fe5901 to 83adfea Compare October 14, 2026 19:57
@zackees
zackees enabled auto-merge October 14, 2026 20:13
@zackees
zackees added this pull request to the merge queue Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: frontend: Show/Hide Transition from the Sources context menu changes one of the selected sources only (upstream #10448)

2 participants