-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
UI: Restore frontend API events being dispatched during initialization #11450
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this would have been called elsewhere but I guess we need to explicitly call them 🤔
I haven't been able to check whether it's actually the case, but noticed in code |
Yeah doesn't prevent this one from being merged but it would probably be good to double-check any others if we suspect they could be affected. |
They are called before, but IMO it is more correct that none of these events are dispatched before OBS is initialised, but that change should happen after communicating this change, so I'm fine with adding workarounds for them until then. |
d03d6ed
to
e50a5a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm that this solves the situation where I found the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: initialisation -> initialization
Looks good otherwise.
The frontend API events "OBS_FRONTEND_EVENT_SCENE_CHANGED" and "OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED" are not dispatched if disableSaving has a value > 0. Prior code decremented disableSaving to 0 globally (regardless of whether saving was necessary, which is only the case if a new collection is created as a fallback for a missing scene collection). Thus the updated code exhibits different event dispatch behavior then old code which some plugins might have relied on. To avoid introducing new behavior, explicitly create the environment to allow the dispatch to take place and remove/refactor the events in a later version.
e50a5a5
to
b1e80d2
Compare
Description
Restore dispatch of frontend events that have not been dispatched due to prior refactor.
Motivation and Context
The frontend API events "OBS_FRONTEND_EVENT_SCENE_CHANGED" and "OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED" are not dispatched if disableSaving has a value
> 0
. Prior code decremented disableSaving to0
globally (regardless of whether saving was necessary, which is only the case if a new collection is created as a fallback for a missing scene collection).Thus the updated code exhibits different event dispatch behavior then old code which some plugins might have relied on. To avoid introducing new behavior, explicitly create the environment to allow the dispatch to take place and remove/refactor the events in a later version.
How Has This Been Tested?
Checked frontend dispatch taking place with existing scene collection, scene collection name provided via command-line argument as well as with missing scene collection.
Types of changes
Checklist: