fix GUI VSTi trắng/không load: DPI per-monitor v2 + WS_CLIPCHILDREN + view->onSize() sau attached; restore API manager header/cpp (2596372 xoá nhầm) và deploy exe mới

This commit is contained in:
2026-08-15 16:12:29 +07:00
parent 90241f626f
commit 0cec3d3cce
5 changed files with 127 additions and 1 deletions
+8
View File
@@ -555,10 +555,12 @@ bool Vst3Instrument::attachView(void* parentWindowHandle) {
auto* s = static_cast<Vst3HostState*>(state_);
if (!s || !s->controller || !parentWindowHandle) return false;
IPlugView* rawView = nullptr;
s->controller->queryInterface(IPlugView::iid, (void**)&rawView);
FUnknownPtr<IPlugView> view(rawView);
if (!view) {
// Mot so plugin khong expose IPlugView tren edit controller; thu component.
IPlugView* rawViewC = nullptr;
s->component->queryInterface(IPlugView::iid, (void**)&rawViewC);
view = FUnknownPtr<IPlugView>(rawViewC);
}
if (!view) {
@@ -566,7 +568,9 @@ bool Vst3Instrument::attachView(void* parentWindowHandle) {
// JUCE-based plugins (Scaler2) expose the editor only this way.
view = owned(s->controller->createView(Steinberg::Vst::ViewType::kEditor));
}
if (!view) return false;
view->setFrame(&s->plugFrame);
view->isPlatformTypeSupported(kPlatformTypeHWND);
tresult ta = view->attached(parentWindowHandle, kPlatformTypeHWND);
if (ta != kResultOk) return false;
#ifdef _WIN32
@@ -578,6 +582,10 @@ bool Vst3Instrument::attachView(void* parentWindowHandle) {
RECT r = { 0, 0, w, h };
AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW, FALSE);
SetWindowPos(hwnd, nullptr, 0, 0, r.right - r.left, r.bottom - r.top, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
// Tell the plugin the client size right after attach — some editors
// (Skia/OpenGL-based) skip their first paint until onSize arrives,
// leaving a blank/white surface.
view->onSize(&rect);
}
#endif
s->view = view;