Fix Qin GUI nền trắng khi mở lại + MIDI keyboard preview trong GUI bị câm
- plugin_host_main.cpp WM_CLOSE: destroy host window (sau effEditClose jBridge dialog cũ vẫn sống trong host; mở lại trên cùng window tạo jBridge dialog thứ 2 chồng lên -> nền trắng, editor không load). Mở lại tạo window mới sạch, đúng 1 jBridge dialog + Qin_VST_Window. - plugin_host_main.cpp: bỏ idle-skip khi editor đang attach — preview phím MIDI trong GUI là âm nội bộ plugin, không qua host MIDI; vòng loop idle không gọi processAudioBlock nên voice nội bộ không bao giờ render (câm). GUI mở -> render liên tục; GUI đóng vẫn idle như cũ. - Verify: mở/đóng/mở lại GUI ch1 -> host mới, đúng 1 editor, âm ch1 peak 0.13 (GUI mở) / 0.10 (sau đóng); bridgeWrite tăng liên tục khi GUI mở.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user