fix(fx-gui): /show resize window+plugin view theo rect panel (layout khớp ô embed) — giữ offscreen, không topmost; sync sidecar mới vào bundle _internal

This commit is contained in:
2026-08-22 17:52:16 +07:00
parent 4bb0db2b21
commit f143646ba7
6 changed files with 110 additions and 4 deletions
+14 -4
View File
@@ -514,11 +514,21 @@ void runHttpServer(HWND hwnd, std::atomic<bool>& stop) {
if (sroot) std::free(sroot);
// Embedded mode: the native window NEVER comes on-screen — it stays
// parked off-screen at -20000,-20000 (GDI capture + synthetic input
// work regardless of position). The panel rect is still recorded
// for the (disabled) real-input fallback and to keep the API
// contract; /hide hid the window, so re-show it off-screen so
// work regardless of position). The panel rect sizes the host
// window + plugin view so the capture frame matches the embed panel
// (layout bug); /hide hid the window, so re-show it off-screen so
// /frame keeps capturing.
(void)rectOk;
if (rectOk) {
const int cw = g_embedRect.right - g_embedRect.left;
const int ch = g_embedRect.bottom - g_embedRect.top;
RECT cur = {};
GetWindowRect(hwnd, &cur);
// Skip when already the right size: frontend re-POSTs /show
// every ~500ms; re-laying-out the plugin view every tick is
// wasteful (WM_FXGUI_RESIZE -> checkSizeConstraint/onSize).
if (cur.right - cur.left != cw || cur.bottom - cur.top != ch)
fxGuiRequestResize(hwnd, cw, ch);
}
if (!IsWindowVisible(hwnd))
SetWindowPos(hwnd, HWND_NOTOPMOST, -20000, -20000, 0, 0,
SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);