Use explicit workspace mutation requests for window sync

This commit is contained in:
2026-04-26 00:25:49 +08:00
parent 5b6c46d382
commit c62a7fec0a
10 changed files with 130 additions and 23 deletions

View File

@@ -33,8 +33,10 @@ EditorWindowContentCursorKind ToContentCursorKind(
} // namespace
EditorWorkspaceWindowContentController::EditorWorkspaceWindowContentController(
std::string windowId,
UIEditorWorkspaceController workspaceController)
: m_workspaceController(std::move(workspaceController)) {}
: m_windowId(std::move(windowId)),
m_workspaceController(std::move(workspaceController)) {}
EditorWorkspaceWindowContentController::~EditorWorkspaceWindowContentController() = default;
@@ -131,6 +133,7 @@ EditorWindowFrameTransferRequests EditorWorkspaceWindowContentController::Update
transferRequests.workspace.workspaceMutation = EditorWindowWorkspaceMutationRequest{
.windowState =
UIEditorWindowWorkspaceState{
.windowId = m_windowId,
.workspace = m_workspaceController.GetWorkspace(),
.session = m_workspaceController.GetSession(),
},
@@ -220,8 +223,10 @@ std::string EditorWorkspaceWindowContentController::ResolveDetachedWindowTitleTe
}
std::unique_ptr<EditorWindowContentController> CreateEditorWorkspaceWindowContentController(
std::string_view windowId,
UIEditorWorkspaceController workspaceController) {
return std::make_unique<EditorWorkspaceWindowContentController>(
std::string(windowId),
std::move(workspaceController));
}