Skip to content

shared/properties-view: Report a field's change before another field's - #766

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/filter-undo-coalesce
Oct 14, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/filter-undo-coalesce

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Fixes #765

What and why

When two fields of a properties view change within half a second, each change now gets its own update callback with the right old and new settings, so the Filters dialog's Undo and Redo step through the changes as they were made (upstream obsproject/obs-studio#10628, reported by norihiro with exact steps and a log of the undo data, still open).

  • WidgetInfo::ControlChanged() (shared/properties-view/properties-view.cpp line 2037) waits 500 ms after a change (line 2119) before calling the update callback, so typing into one field gives one callback. The timer and the saved old settings belong to each field, but the callback gets the view's whole current settings as the new ones (line 2108). If a second field changed within those 500 ms, the first field's callback already included it.
  • The Filters dialog adds one undo entry per callback (FilterChangeUndoRedo(), frontend/dialogs/OBSBasicFilters.cpp line 181). Crop/Pad Left = 1 and Top = 2 typed quickly gave {0, 0} -> {1, 2} and {1, 0} -> {1, 2}: Undo twice and Redo once ended at Left = 1, Top = 2 instead of Left = 1, Top = 0.
  • When a field starts a new change, the view now first calls CommitPendingUpdates(), which reports any other field's waiting change right away, before the new change is applied. The callback code moved from the timer lambda into WidgetInfo::CommitUpdate(), which the timer still calls after 500 ms. One field typed quickly is still one callback. The Filters dialog is the only user of the callback today.

Reproduced in release v0.1.0-beta.20261014 (AppImage, headless: private Xvfb, private HOME, dbus-run-session, --multi) with a small test module that adds a Color Source with Crop/Pad, sets Left = 1 then Top = 2 in the Filters dialog, closes and reopens it, then presses Edit > Undo twice and Edit > Redo once. The same module against this branch (Rust libobs lane, with the frontend):

After Undo, Undo, Redo Release This branch
Left and Top set 100 ms apart Left 1, Top 2 Left 1, Top 0
Left and Top set 800 ms apart (control) Left 1, Top 0 Left 1, Top 0

Not changed: a field whose change makes the view rebuild its widgets drops the old widgets' waiting change, as before (read from the code, not run).

RED → GREEN

  • RED commit: 9cd86d9d7 test/cmocka: Add failing test for undo entries of quick property changes. test_properties_undo_coalesce builds the real OBSPropertiesView (and its shared Qt helpers, without the frontend) with two integer fields on Qt's offscreen platform and records every update callback. 2 of 4 fail in both lanes: two_fields_within_window (entry 0 is {0, 0} -> {1, 2}), back_and_forth_within_window. Controls pass: one_field_coalesces, two_fields_apart.
  • GREEN: 708481779. 4 of 4 with ENABLE_RUST_LIBOBS OFF and ON, also with DISPLAY unset; the test waits on real timers, so it was repeated 20 times per lane: 20/20. Full ctest (private Xvfb, system libobs-opengl masked, TMPDIR unset): 215/215 in both lanes, every PipeWire/PulseAudio test ran; skipped only open_crashes_without_obs_core, test_startup_shutdown_cycles and (C lane) test_alloc_count_stable_after_startup, as on master here. clang-format, gersemi and ci/test_registration.py clean. Needs Qt6 Test (qt6-base-dev); not checked against Tier 2 yet.

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 port

AI note: 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

The properties view (Filters, and the other dialogs that use
shared/properties-view) waits 500 ms after a change before it reports
the old and new settings, so that typing into one field gives one undo
entry. Each field keeps its own timer and its own copy of the old
settings, but reports the view's whole current settings as the new
ones. Setting Crop/Pad Left = 1 and then Top = 2 within 500 ms gives
Left's entry the new settings {left 1, top 2}; Undo twice and Redo once
then ends at Left = 1, Top = 2 instead of Left = 1, Top = 0.

test_properties_undo_coalesce builds the real OBSPropertiesView with two
integer fields on the offscreen platform and records every update
callback. Two fields within 500 ms and Left, Top, Left within 500 ms
fail. Controls pass: one field changed twice within 500 ms is one entry,
and two fields 700 ms apart are two correct entries.

Refs obs-rust#765.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rdoupe
rdoupe requested a review from zackees as a code owner October 14, 2026 20:58
@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
@zackees
zackees enabled auto-merge October 14, 2026 21:10
Each field of a properties view waits 500 ms after a change before it
calls the update callback with the old settings it saved and the view's
current settings. When a second field changed within those 500 ms, the
first field's report included the second change as well. In the
Filters dialog the first undo entry then redid both changes: Crop/Pad
Left = 1 and Top = 2 typed quickly, Undo twice and Redo once gave
Left = 1, Top = 2 instead of Left = 1, Top = 0.

When a field starts a new change, the view now first reports any other
field's change that is still waiting (CommitPendingUpdates), so every
entry holds exactly the settings before and after its own change.
Changes to one field within 500 ms are still one entry.

Fixes obs-rust#765.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=380b5d850b8e1811cfbf7d7266f9d26ded424ef3 secs=581 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792012220,"gate":"rust/all/fmt","host":"linux-x86_64","key":"7157d564f41a6872f1873543b7208449d4a743a6996f334d5adbc032c3367c6d","lane":"lint","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":66,"stamp":"dab8ae9542d24d48ae3e2e94a4a0aff4","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"7157d564f41a6872f1873543b7208449d4a743a6996f334d5adbc032c3367c6d","lane":"lint","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":66,"stamp":"a9768537bcbd635ea6ffd2ef83232ba2","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"64dacd7c112093ee5799679df00c349a323625a19a835a2bac806325502bfa08","lane":"rust-test","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":151,"stamp":"d2d9c1b95066b948d038dbcf17f5c3f6","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"ebfb93d8477427ad491b8731c8cb6b27e188321dd92cb2a2af74bbfb0b1f9daa","lane":"cross","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":99,"stamp":"a3de2a6e35d31b82628a96c92ff5936e","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"ebfb93d8477427ad491b8731c8cb6b27e188321dd92cb2a2af74bbfb0b1f9daa","lane":"cross","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":99,"stamp":"ea2c530bfb96f4bbb7f230ee076ece48","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"ebfb93d8477427ad491b8731c8cb6b27e188321dd92cb2a2af74bbfb0b1f9daa","lane":"cross","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":99,"stamp":"4991648b4d156cb250638b470aad6e0d","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"ebfb93d8477427ad491b8731c8cb6b27e188321dd92cb2a2af74bbfb0b1f9daa","lane":"cross","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":99,"stamp":"6b36baf26ee317963e277f609e7ab730","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"ebfb93d8477427ad491b8731c8cb6b27e188321dd92cb2a2af74bbfb0b1f9daa","lane":"cross","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":99,"stamp":"344fdaa7038cc3353d301227e709da62","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"ebfb93d8477427ad491b8731c8cb6b27e188321dd92cb2a2af74bbfb0b1f9daa","lane":"cross","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":99,"stamp":"fcf4ecbbe3225f171dcccfb173e5b23a","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
Ci-Attestation: {"at":1792012220,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"a7c538c5d67b984c0477d296a440ddbbbdabcb47b32f3512341fde970f56d046","lane":"tier2-linux","parents":["666e2f222a1d4cbf4e5eba7a36c38240d1724b8d"],"secs":264,"stamp":"10d9fa80f4a2efa075e187ec1c5dd740","tree":"380b5d850b8e1811cfbf7d7266f9d26ded424ef3","v":1,"via":"run"}
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Rebased onto master, set ci-full, and ran the stamped local gate, which includes Tier 2 Linux (OFF/ON) in the CI image. Your RED (test_properties_undo_coalesce: 2 of 4 fail, both lanes) / GREEN evidence above stands.

  • Rebased on master, local gate passed; pushed as 71df78c.

@zackees
zackees force-pushed the fix/filter-undo-coalesce branch from 44667ea to 71df78c Compare October 14, 2026 21:10
@zackees

zackees commented Oct 14, 2026

Copy link
Copy Markdown
Member

Tier 2 check you hadn't run: in the stamped local gate (CI image), test_properties_undo_coalesce builds and passes in both lanes: 144/215 Test #144: test_properties_undo_coalesce ... Passed 4.16 sec (OFF) and 4.17 sec (ON). It runs, it isn't skipped, so Qt6 Test is available there. Queued in the merge queue.

@zackees
zackees added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@zackees
zackees added this pull request to the merge queue Oct 14, 2026
Merged via the queue into obs-rust:master with commit 91615e1 Oct 14, 2026
48 of 50 checks passed
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: shared/properties-view: undo entries are wrong when two filter settings change within 500 ms (upstream #10628)

2 participants