mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-21 12:03:43 -05:00
Let OBS handle dock restoration on first startup and cleanup on shutdown
The "manual" attempt at restoring the docks should only be performed on scene collection change as OBS will already take care of this on starutp. Do not delete the macro dock widgets on shutdown so OBS is able to save their location and size properly.
This commit is contained in:
parent
dea4ff47cd
commit
65545d85ba
|
|
@ -516,6 +516,7 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
|
|||
|
||||
// Reset on startup and scene collection change
|
||||
switcher->lastOpenedTab = -1;
|
||||
startupLoadDone = true;
|
||||
}
|
||||
|
||||
void SwitcherData::SaveSettings(obs_data_t *obj)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,12 @@ Macro::~Macro()
|
|||
_die = true;
|
||||
Stop();
|
||||
ClearHotkeys();
|
||||
RemoveDock();
|
||||
|
||||
// Keep the dock widgets in case of shutdown so they can be rostored by
|
||||
// OBS on startup
|
||||
if (!switcher->obsIsShuttingDown) {
|
||||
RemoveDock();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Macro>
|
||||
|
|
@ -705,14 +710,16 @@ void Macro::EnableDock(bool value)
|
|||
// geometry set here.
|
||||
// The function calls here are only intended to attempt to restore the
|
||||
// dock status when switching scene collections.
|
||||
_dock->setVisible(_dockIsVisible);
|
||||
if (window->dockWidgetArea(_dock) != _dockArea) {
|
||||
window->addDockWidget(_dockArea, _dock);
|
||||
if (switcher->startupLoadDone) {
|
||||
_dock->setVisible(_dockIsVisible);
|
||||
if (window->dockWidgetArea(_dock) != _dockArea) {
|
||||
window->addDockWidget(_dockArea, _dock);
|
||||
}
|
||||
if (_dock->isFloating() != _dockIsFloating) {
|
||||
_dock->setFloating(_dockIsFloating);
|
||||
}
|
||||
_dock->restoreGeometry(_dockGeo);
|
||||
}
|
||||
if (_dock->isFloating() != _dockIsFloating) {
|
||||
_dock->setFloating(_dockIsFloating);
|
||||
}
|
||||
_dock->restoreGeometry(_dockGeo);
|
||||
_registerDock = value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ public:
|
|||
bool firstInterval = true;
|
||||
bool firstIntervalAfterStop = true;
|
||||
int shutdownConditionCount = 0;
|
||||
bool startupLoadDone = false;
|
||||
|
||||
obs_source_t *waitScene = nullptr;
|
||||
OBSWeakSource currentScene = nullptr;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user