Refactor editor window synchronization flow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "Windowing/Content/EditorWorkspaceWindowContentController.h"
|
||||
|
||||
#include <XCEditor/Workspace/UIEditorDetachedWindowPolicy.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceLayoutPersistence.h>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
@@ -108,7 +109,10 @@ void EditorWorkspaceWindowContentController::SetViewportSurfacePresentationEnabl
|
||||
EditorWindowFrameTransferRequests EditorWorkspaceWindowContentController::UpdateAndAppend(
|
||||
const EditorWindowContentFrameContext& context,
|
||||
::XCEngine::UI::UIDrawData& drawData) {
|
||||
return m_frameOrchestrator.UpdateAndAppend(
|
||||
const auto beforeSnapshot = BuildUIEditorWorkspaceLayoutSnapshot(
|
||||
m_workspaceController.GetWorkspace(),
|
||||
m_workspaceController.GetSession());
|
||||
EditorWindowFrameTransferRequests transferRequests = m_frameOrchestrator.UpdateAndAppend(
|
||||
context.editorContext,
|
||||
m_workspaceController,
|
||||
m_shellRuntime,
|
||||
@@ -120,6 +124,19 @@ EditorWindowFrameTransferRequests EditorWorkspaceWindowContentController::Update
|
||||
context.globalTabDragActive,
|
||||
context.useDetachedTitleBarTabStrip,
|
||||
drawData);
|
||||
const auto afterSnapshot = BuildUIEditorWorkspaceLayoutSnapshot(
|
||||
m_workspaceController.GetWorkspace(),
|
||||
m_workspaceController.GetSession());
|
||||
if (!AreUIEditorWorkspaceLayoutSnapshotsEquivalent(beforeSnapshot, afterSnapshot)) {
|
||||
transferRequests.workspace.workspaceMutation = EditorWindowWorkspaceMutationRequest{
|
||||
.windowState =
|
||||
UIEditorWindowWorkspaceState{
|
||||
.workspace = m_workspaceController.GetWorkspace(),
|
||||
.session = m_workspaceController.GetSession(),
|
||||
},
|
||||
};
|
||||
}
|
||||
return transferRequests;
|
||||
}
|
||||
|
||||
void EditorWorkspaceWindowContentController::RenderRequestedViewports(
|
||||
|
||||
Reference in New Issue
Block a user