diff --git a/install/daw_vst_bridge.exe b/install/daw_vst_bridge.exe index bcdc521..c84c848 100644 Binary files a/install/daw_vst_bridge.exe and b/install/daw_vst_bridge.exe differ diff --git a/native_bridge/src/FxGuiServer.cpp b/native_bridge/src/FxGuiServer.cpp index abc032b..c3d86cf 100644 --- a/native_bridge/src/FxGuiServer.cpp +++ b/native_bridge/src/FxGuiServer.cpp @@ -283,7 +283,7 @@ void danceStart(HWND hwnd, HWND target, int x, int y) { SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); } - SetWindowPos(hwnd, HWND_TOP, g_embedRect.left, g_embedRect.top, + SetWindowPos(hwnd, HWND_TOPMOST, g_embedRect.left, g_embedRect.top, cw, ch, SWP_NOACTIVATE | SWP_SHOWWINDOW); fxGuiRequestResize(hwnd, cw, ch); Sleep(60); // let the compositor repaint so the editor sees itself active @@ -520,6 +520,10 @@ void runHttpServer(HWND hwnd, std::atomic& stop) { sendResponse(c, 400, "application/json", "{\"error\":\"bad json\"}", 20); } } else if (req.path == "/hide") { + // Demote first: without it the next SW_SHOW would keep the + // window topmost and it would float over other apps. + SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); ShowWindow(hwnd, SW_HIDE); sendResponse(c, 200, "application/json", "{\"ok\":true}", 11); } else if (req.path == "/show") { @@ -558,7 +562,7 @@ void runHttpServer(HWND hwnd, std::atomic& stop) { // skip both when nothing moved so the plugin view is not // re-laid-out in a loop. Re-show after /hide regardless. if (!same || !IsWindowVisible(hwnd)) - SetWindowPos(hwnd, HWND_TOP, g_embedRect.left, g_embedRect.top, + SetWindowPos(hwnd, HWND_TOPMOST, g_embedRect.left, g_embedRect.top, cw, ch, SWP_NOACTIVATE | SWP_SHOWWINDOW); if (cur.right - cur.left != cw || cur.bottom - cur.top != ch) fxGuiRequestResize(hwnd, cw, ch);