UI,docs: Send a custom event to the dock widget when closing #10516
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
Send a custom event to the OBSDock widget when the dock (from
obs_frontend_add_dock_by_id
) is closed, which allow plugin authors to potentially save resources while the dock is closed.A QShowEvent is already sent to the widget when the dock is (re-)opened.
Motivation and Context
Motivation related to:
Enabling a way closing browser from a plugin dock when the said dock is closed, since OBS Studio completely owns the access to the dock object.
So in a scenario like separating service integration, beside randomly guessing we can't know when close browsers to save resources.
How Has This Been Tested?
Disabled the
closeBrowser()
call in BrowserDockcloseEvent()
impl and added the following to QCefWidgetInternal for testing purpose:The browser is closed when the dock is closed thanks to the event as expected.
Types of changes
Checklist: