fix(vst-gui): borderless fx-gui window + anchored re-show (mouse stable)
- RenderFxJob: offscreen fx-gui window now WS_POPUP (borderless) so GetWindowRect == client rect; anchored placement over the embed panel is exact. WS_OVERLAPPEDWINDOW put the client ~31px lower/right -> cursor jumped on hover and clicks hit the webview (relay rejected). - AdjustWindowRect sizes to the window's own style (no caption for POPUP). - FxGuiServer: mousemove only SetCursorPos while dragging (buttons!=0); hover no longer teleports the cursor. - FxGuiServer /show: skip SetWindowPos/resize when rect unchanged (frontend now re-POSTs /show every ~500ms to re-anchor on scroll/resize). - app.jsx VstGuiEmbed: drop shownRef one-shot; re-POST /show each refresh. - Rebuilt bridge (6 locations) + Tauri release (embedded sidecar) + v=202608190002.
This commit is contained in:
@@ -405,7 +405,10 @@ void relayInput(HWND hwnd, const json_object_s* o) {
|
||||
if (!outside) ClientToScreen(target, &pt);
|
||||
realClick(pt.x, pt.y, true, button);
|
||||
} else if (type == "mousemove") {
|
||||
if (g_dance) {
|
||||
// Drag only: moving the cursor on plain hover fights the webview
|
||||
// (the plugin window sits under the pointer while anchored, so
|
||||
// hover reaches it naturally — no SetCursorPos needed).
|
||||
if (g_dance && buttons != 0) {
|
||||
POINT pt = { x, y };
|
||||
ClientToScreen(target, &pt);
|
||||
SetCursorPos(pt.x, pt.y);
|
||||
@@ -545,12 +548,20 @@ void runHttpServer(HWND hwnd, std::atomic<bool>& stop) {
|
||||
}
|
||||
if (sroot) std::free(sroot);
|
||||
if (rectOk) {
|
||||
SetWindowPos(hwnd, HWND_TOP, g_embedRect.left, g_embedRect.top,
|
||||
g_embedRect.right - g_embedRect.left,
|
||||
g_embedRect.bottom - g_embedRect.top,
|
||||
SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
||||
fxGuiRequestResize(hwnd, g_embedRect.right - g_embedRect.left,
|
||||
g_embedRect.bottom - g_embedRect.top);
|
||||
const int cw = g_embedRect.right - g_embedRect.left;
|
||||
const int ch = g_embedRect.bottom - g_embedRect.top;
|
||||
RECT cur = {};
|
||||
GetWindowRect(hwnd, &cur);
|
||||
const bool same = cur.left == g_embedRect.left && cur.top == g_embedRect.top &&
|
||||
cur.right - cur.left == cw && cur.bottom - cur.top == ch;
|
||||
// Frontend re-POSTs /show every ~500ms to re-anchor on scroll;
|
||||
// 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,
|
||||
cw, ch, SWP_NOACTIVATE | SWP_SHOWWINDOW);
|
||||
if (cur.right - cur.left != cw || cur.bottom - cur.top != ch)
|
||||
fxGuiRequestResize(hwnd, cw, ch);
|
||||
g_dance = true;
|
||||
g_anchored = true;
|
||||
g_parkUntil = 0;
|
||||
|
||||
Reference in New Issue
Block a user