diff --git a/native_bridge/src/plugin_host_main.cpp b/native_bridge/src/plugin_host_main.cpp index bf340ce..9c38f9c 100644 --- a/native_bridge/src/plugin_host_main.cpp +++ b/native_bridge/src/plugin_host_main.cpp @@ -55,8 +55,13 @@ static LRESULT CALLBACK PluginHostWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP if (g_wndInst) { try { g_wndInst->closeGUI(); } catch (...) {} } - if (g_hostHwnd) ShowWindow(g_hostHwnd, SW_HIDE); - return 0; // swallow: do NOT let DefWindowProc destroy the window + // effEditClose leaves the jBridge wrapper dialog + stale editor + // children alive; re-opening on the SAME window stacks a second + // dialog on top -> white background, editor never loads. Destroy + // the window so the next OPEN_GUI creates a fresh one. + g_hostHwnd = nullptr; + DestroyWindow(hwnd); + return 0; // swallow: we destroyed it ourselves case WM_DESTROY: if (g_wndInst) { try { g_wndInst->closeGUI(); } catch (...) {} @@ -330,7 +335,7 @@ int main(int argc, char* argv[]) { printf("[plugin_host] parent gone - exiting\n"); break; } - if (idle) { + if (idle && !inst.hasAttachedView()) { // GUI preview needs continuous rendering Sleep(15); continue; }