Repository navigation
shared/properties-view: Report a field's change before another field's - #766
Merged
Merged
Conversation
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]>
zackees
approved these changes
Oct 14, 2026
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"}
Member
|
Rebased onto master, set
|
zackees
force-pushed
the
fix/filter-undo-coalesce
branch
from
October 14, 2026 21:10
44667ea to
71df78c
Compare
Member
|
Tier 2 check you hadn't run: in the stamped local gate (CI image), |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 14, 2026
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.cppline 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.FilterChangeUndoRedo(),frontend/dialogs/OBSBasicFilters.cppline 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.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 intoWidgetInfo::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):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
test/cmocka: Add failing test for undo entries of quick property changes.test_properties_undo_coalescebuilds the realOBSPropertiesView(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.ENABLE_RUST_LIBOBSOFF and ON, also withDISPLAYunset; the test waits on real timers, so it was repeated 20 times per lane: 20/20. Full ctest (private Xvfb, systemlibobs-openglmasked, TMPDIR unset): 215/215 in both lanes, every PipeWire/PulseAudio test ran; skipped onlyopen_crashes_without_obs_core,test_startup_shutdown_cyclesand (C lane)test_alloc_count_stable_after_startup, as on master here. clang-format, gersemi andci/test_registration.pyclean. Needs Qt6 Test (qt6-base-dev); not checked against Tier 2 yet.Checklist
master-W..., ratchets): noneAI 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