Refactor new editor state ownership model

This commit is contained in:
2026-04-19 04:36:52 +08:00
parent 48bfde28e3
commit f45b34a03a
46 changed files with 1979 additions and 217 deletions

View File

@@ -405,7 +405,7 @@ bool EditorWindowWorkspaceCoordinator::HandleGlobalTabDragPointerButtonUp(HWND h
}
UIEditorWindowWorkspaceController windowWorkspaceController =
BuildLiveWindowWorkspaceController(targetWindow->GetWindowId());
BuildWorkspaceMutationController();
const UIEditorWindowWorkspaceOperationResult result =
dropTarget.placement == UIEditorWorkspaceDockPlacement::Center
? windowWorkspaceController.MovePanelToStack(
@@ -427,7 +427,7 @@ bool EditorWindowWorkspaceCoordinator::HandleGlobalTabDragPointerButtonUp(HWND h
return true;
}
if (!SynchronizeWindowsFromController(
if (!CommitWindowWorkspaceMutation(
windowWorkspaceController,
{},
screenPoint)) {
@@ -468,7 +468,7 @@ bool EditorWindowWorkspaceCoordinator::TryStartGlobalTabDrag(
[this, &request, &dragHotspot](
UIEditorWindowWorkspaceController& windowWorkspaceController,
const UIEditorWindowWorkspaceOperationResult& result) {
if (!SynchronizeWindowsFromController(
if (!CommitWindowWorkspaceMutation(
windowWorkspaceController,
result.targetWindowId,
request.screenPoint)) {
@@ -500,7 +500,7 @@ bool EditorWindowWorkspaceCoordinator::TryStartGlobalTabDrag(
};
UIEditorWindowWorkspaceController windowWorkspaceController =
BuildLiveWindowWorkspaceController(sourceWindow.GetWindowId());
BuildWorkspaceMutationController();
const UIEditorWindowWorkspaceOperationResult result =
windowWorkspaceController.DetachPanelToNewWindow(
sourceWindow.GetWindowId(),
@@ -557,7 +557,7 @@ bool EditorWindowWorkspaceCoordinator::TryProcessDetachRequest(
const std::string sourceWindowId(sourceWindow.GetWindowId());
UIEditorWindowWorkspaceController windowWorkspaceController =
BuildLiveWindowWorkspaceController(sourceWindowId);
BuildWorkspaceMutationController();
const UIEditorWindowWorkspaceOperationResult result =
windowWorkspaceController.DetachPanelToNewWindow(
sourceWindowId,
@@ -568,7 +568,7 @@ bool EditorWindowWorkspaceCoordinator::TryProcessDetachRequest(
return false;
}
if (!SynchronizeWindowsFromController(
if (!CommitWindowWorkspaceMutation(
windowWorkspaceController,
result.targetWindowId,
request.screenPoint)) {