frontend: Only emit frontend events for existing scene collection #11897
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
Change emission of frontend events for scene collection and scene changes during startup only for existing scenes.
Motivation and Context
To emit frontend events early during OBS' initialisation, the
disableSaving
state variable needs to be "falsy" (as events will not be emitted otherwise).The code path taken for generating a new fallback scene collection has
disableSaving
decremented to "enable" saving (and thus frontend events) already, so it's just the code paths for existing collections that need this workaround.Emitting the "scene changed" and "preview scene changed" events when a fallback scene collection has been created has side-effects when OBS Studio is set to studio mode and can lead to potential crashes, as the studio mode is still in an invalid state at this point.
How Has This Been Tested?
Tested by launching OBS with studio mode active but without the configured scene collection available.
Types of changes
Checklist: