Refactor new editor state ownership model
This commit is contained in:
@@ -182,14 +182,26 @@ bool EditorWindowWorkspaceCoordinator::SynchronizeWindowsFromWindowSet(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorWindowWorkspaceCoordinator::SynchronizeWindowsFromController(
|
||||
bool EditorWindowWorkspaceCoordinator::CommitWindowWorkspaceMutation(
|
||||
const UIEditorWindowWorkspaceController& windowWorkspaceController,
|
||||
std::string_view preferredNewWindowId,
|
||||
const POINT& preferredScreenPoint) {
|
||||
return SynchronizeWindowsFromWindowSet(
|
||||
windowWorkspaceController.GetWindowSet(),
|
||||
preferredNewWindowId,
|
||||
preferredScreenPoint);
|
||||
const UIEditorWindowWorkspaceSet nextWindowSet = windowWorkspaceController.GetWindowSet();
|
||||
std::string error = {};
|
||||
if (!m_workspaceStore.ValidateWindowSet(nextWindowSet, error)) {
|
||||
LogRuntimeTrace("window", "workspace mutation validation failed: " + error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SynchronizeWindowsFromWindowSet(
|
||||
nextWindowSet,
|
||||
preferredNewWindowId,
|
||||
preferredScreenPoint)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_workspaceStore.ReplaceWindowSet(nextWindowSet);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App::Internal
|
||||
|
||||
Reference in New Issue
Block a user