Skip to content

Conversation

@Warchamp7
Copy link
Member

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 UpdateContextBarDeferred and UpdateEditMenu, 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

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

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@Warchamp7 Warchamp7 added the Bug Fix Non-breaking change which fixes an issue label Jan 15, 2026
Copy link
Member

@PatTheMav PatTheMav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's logically more correct. Haven't run in-depth tests whether this change to the better has other unexpected side-effects though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Fix Non-breaking change which fixes an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-functional toolbar buttons after inserting source in a folded group

3 participants