frontend: Move source selection handling to parent #13028
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.
Description
Moves the calls to update various UI elements in OBSBasic from the SourceTreeItems up to SourceTree itself.
Fixes #13026
Motivation and Context
Currently certain parts of the UI are updated whenever an individual SourceTreeItem is selected or deselected. This leads to the bug in #13026 as the item gets removed from the source list before it can call
Deselect.This PR moves the UI update calls to the event in the SourceTree itself instead. This also has the side effect of removing some redundant calls to
UpdateContextBarDeferredandUpdateEditMenu, though the former is deferred anyway.The fact that SourceTreeItems even hold a reference and make direct calls to the SourceTree is bad. The entire event hierarchy here is inverted with a lot of redundancy and arcane managing of
libobs. It should be cleaned up in the future.How Has This Been Tested?
Selected multiple items, deselected multiple items, both in and outside of groups, including mixed selections.
Types of changes
Checklist: