new_editor: filter closing windows from interaction

This commit is contained in:
2026-04-17 22:35:16 +08:00
parent ba8437d919
commit bf9a906464
3 changed files with 49 additions and 13 deletions

View File

@@ -276,7 +276,9 @@ void EditorWindowHostRuntime::RenderAllWindows(
transferBatches.reserve(m_windows.size());
for (const std::unique_ptr<EditorWindow>& window : m_windows) {
if (window == nullptr || window->GetHwnd() == nullptr) {
if (window == nullptr ||
window->GetHwnd() == nullptr ||
window->IsClosing()) {
continue;
}
@@ -293,7 +295,9 @@ void EditorWindowHostRuntime::RenderAllWindows(
}
for (WindowFrameTransferBatch& batch : transferBatches) {
if (batch.sourceWindow == nullptr || batch.sourceWindow->GetHwnd() == nullptr) {
if (batch.sourceWindow == nullptr ||
batch.sourceWindow->GetHwnd() == nullptr ||
batch.sourceWindow->IsClosing()) {
continue;
}
@@ -310,7 +314,9 @@ void EditorWindowHostRuntime::HandleDestroyedWindow(HWND hwnd) {
for (const std::unique_ptr<EditorWindow>& otherWindow : m_windows) {
if (otherWindow != nullptr &&
otherWindow.get() != window &&
otherWindow->GetHwnd() != nullptr) {
otherWindow->GetHwnd() != nullptr &&
!otherWindow->IsClosing()) {
otherWindow->MarkClosing();
PostMessageW(otherWindow->GetHwnd(), WM_CLOSE, 0, 0);
}
}