Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs,UI: Replace and deprecate obs_scene_sceneitem_from_source #11251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 11, 2024

  1. UI: Replace usage of obs_scene_sceneitem_from_source

    Instead of first creating the scene item and then finding it again using
    a method that's generally problematic (and only works here because we
    know that there is only one instance of a source), let's just remember
    the scene item in AddNew after we create it, similar to the source
    itself.
    gxalpha committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    7737d58 View commit details
    Browse the repository at this point in the history
  2. libobs: Deprecate obs_scene_sceneitem_from_source

    obs_scene_sceneitem_from_source is problematic because there can be
    multiple items of the same source in a scene, which the function doesn't
    account for. In such a case, it would return the first item it finds,
    which often might not be what a developer expects.
    
    It was originally added for the undo/redo-operation of "Add New Source"
    where the UI guarantees that the item is unique, but for a general case
    it's not suitable.
    gxalpha committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    d4c8e93 View commit details
    Browse the repository at this point in the history