Harden editor app windowing boundary

This commit is contained in:
2026-04-26 16:01:07 +08:00
parent f4afaf184e
commit ac626d48c4
31 changed files with 473 additions and 553 deletions

View File

@@ -5,10 +5,8 @@
#include "Platform/Win32/Runtime/EditorWindowFrameDriver.h"
#include "Platform/Win32/Windowing/EditorWindowSession.h"
#include "Platform/Win32/Windowing/EditorWindowSupport.h"
#include "Windowing/Frame/EditorWindowFrameOrchestrator.h"
#include "Platform/Win32/Runtime/EditorWindowInputController.h"
#include "Platform/Win32/Runtime/EditorWindowRuntimeController.h"
#include "Composition/EditorContext.h"
#include <XCEditor/Docking/UIEditorDockHostTransfer.h>
#include <XCEditor/Foundation/UIEditorRuntimeTrace.h>
#include <XCEditor/Shell/UIEditorShellInteraction.h>
@@ -98,7 +96,6 @@ EditorWindow::EditorWindow(
chromePolicy,
primary))
, m_chromeController(std::make_unique<EditorWindowChromeController>())
, m_frameOrchestrator(std::make_unique<EditorWindowFrameOrchestrator>())
, m_inputController(std::make_unique<EditorWindowInputController>())
, m_runtime(std::make_unique<EditorWindowRuntimeController>(
std::move(contentController))) {}
@@ -641,12 +638,12 @@ EditorWindowFrameTransferRequests EditorWindow::RenderFrame(
kShellSurfaceColor);
EditorWindowFrameTransferRequests transferRequests = {};
if (editorContext.IsValid()) {
if (m_runtime->IsEditorContextValid(editorContext)) {
transferRequests =
RenderRuntimeFrame(editorContext, globalTabDragActive, workspaceBounds, drawData);
} else {
UIDrawList& invalidDrawList = drawData.EmplaceDrawList("XCEditorWindow.Invalid");
m_frameOrchestrator->AppendInvalidFrame(editorContext, invalidDrawList);
m_runtime->AppendInvalidFrame(editorContext, invalidDrawList);
}
UIDrawList& windowChromeDrawList = drawData.EmplaceDrawList("XCEditorWindow.Chrome");
@@ -721,7 +718,7 @@ EditorWindowFrameTransferRequests EditorWindow::RenderRuntimeFrame(
std::vector<UIInputEvent> frameEvents = m_inputController->TakePendingEvents();
const bool useDetachedTitleBarTabStrip =
m_chromeController->ShouldUseDetachedTitleBarTabStrip(*this);
editorContext.AttachTextMeasurer(m_runtime->GetTextMeasurer());
m_runtime->PrepareEditorContext(editorContext);
const Host::D3D12WindowRenderLoopFrameContext frameContext = m_runtime->BeginFrame();
if (!frameContext.warning.empty()) {
LogRuntimeTrace("viewport", frameContext.warning);