new_editor: stabilize multi-window host lifecycle

This commit is contained in:
2026-04-22 00:19:06 +08:00
parent 08ff505b67
commit 0411cd0ec1
10 changed files with 280 additions and 27 deletions

View File

@@ -183,6 +183,10 @@ void EditorWindow::ClearClosing() {
m_state->window.closing = false;
}
void EditorWindow::SetPrimary(bool primary) {
m_state->window.primary = primary;
}
void EditorWindow::SetTrackingMouseLeave(bool trackingMouseLeave) {
m_inputController->SetTrackingMouseLeave(trackingMouseLeave);
}
@@ -231,6 +235,15 @@ bool EditorWindow::Initialize(
}
void EditorWindow::Shutdown() {
std::ostringstream trace = {};
trace << "EditorWindow::Shutdown begin windowId='" << GetWindowId()
<< "' hwnd=0x" << std::hex << std::uppercase
<< reinterpret_cast<std::uintptr_t>(GetHwnd())
<< std::dec
<< " primary=" << (IsPrimary() ? 1 : 0)
<< " closing=" << (IsClosing() ? 1 : 0)
<< " runtimeReady=" << (m_runtime->IsReady() ? 1 : 0);
LogRuntimeTrace("window-close", trace.str());
ForceReleasePointerCapture();
if (m_runtime->IsReady()) {
@@ -238,6 +251,9 @@ void EditorWindow::Shutdown() {
}
m_inputController->ClearPendingEvents();
m_chromeController->Reset();
LogRuntimeTrace(
"window-close",
"EditorWindow::Shutdown end windowId='" + std::string(GetWindowId()) + "'");
}
void EditorWindow::ResetInteractionState() {