fix: show plugin GUI in-process (inside Ableton window) not from Helper
Browse filesROOT CAUSE: Moving GUI to Helper process broke it. macOS treats Helper
as separate app → opens in different Space when fullscreen.
SOLUTION: PluginBridge.vst3 (in-process) loads a GUI-only plugin instance.
This instance doesn't process audio — it's only for displaying the editor.
Ableton manages it as a normal plugin window (same as Pro-Q 4 native).
Parameter sync: GUI instance ↔ Helper via IPC (bidirectional).
- User moves knob on GUI → notify Helper → Helper updates real instance
- MCP/automation changes param on Helper → notify Plugin → update GUI instance
Helper no longer shows any GUI window.
3 unmodified lines4567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465667897 unmodified lines1718198020212253 unmodified lines767778140798081138 unmodified lines2202212222232242252262272282882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193202292302312322332343253263273283293303313322352362372383 unmodified lines#include <pthread.h>#include <sched.h>
#if JUCE_MAC#include <objc/objc.h>#include <objc/message.h>#endif
// Configure window for floating-panel behavior that works in fullscreen// MUST be called BEFORE the window is made visiblestatic void configureAsOverlayPanel(juce::Component* window){#if JUCE_MAC if (auto* peer = window->getPeer()) { auto* nsWindow = (id)peer->getNativeHandle();
// --- COLLECTION BEHAVIOR (MUST be set before visible) --- // canJoinAllSpaces = 1 << 0 (appear on all desktops/spaces) // fullScreenAuxiliary = 1 << 8 (can appear over fullscreen apps) // stationary = 1 << 4 (don't move with space switches) // ignoresCycle = 1 << 6 (skip in Cmd+` cycling) long behavior = (1 << 0) | (1 << 8) | (1 << 4) | (1 << 6); ((void(*)(id, SEL, long))objc_msgSend)(nsWindow, sel_registerName("setCollectionBehavior:"), behavior);
// --- WINDOW LEVEL --- // Level 25 = NSStatusWindowLevel (above fullscreen apps) ((void(*)(id, SEL, long))objc_msgSend)(nsWindow, sel_registerName("setLevel:"), 25);
// Don't hide when the helper app loses focus ((void(*)(id, SEL, int))objc_msgSend)(nsWindow, sel_registerName("setHidesOnDeactivate:"), 0); }#endif}
// Make the window appear without stealing focus (call AFTER visible)static void showWithoutFocusSteal(juce::Component* window){#if JUCE_MAC if (auto* peer = window->getPeer()) { auto* nsWindow = (id)peer->getNativeHandle(); ((void(*)(id, SEL))objc_msgSend)(nsWindow, sel_registerName("orderFrontRegardless")); }#endif}
// Custom window — no native title bar close issues with accessory policyclass PluginGuiWindow : public juce::DocumentWindow{public: PluginGuiWindow(const juce::String& name) : DocumentWindow(name, juce::Colour(0xff1a1a2e), DocumentWindow::allButtons, true) { setUsingNativeTitleBar(true); }
void closeButtonPressed() override { setVisible(false); }};
HelperPluginHost::HelperPluginHost(){ #if JUCE_PLUGINHOST_VST37 unmodified linesHelperPluginHost::~HelperPluginHost(){ stopProcessing(); hideGui(); unloadPlugin();}
53 unmodified lines
void HelperPluginHost::unloadPlugin(){ hideGui(); if (plugin) { plugin->releaseResources();138 unmodified lines}
// --- GUI ---// GUI is NO LONGER handled by the Helper process.// It's now handled in-process by PluginBridgeEditor (inside Ableton).// These stubs remain for IPC compatibility but do nothing.
void HelperPluginHost::showGui(){ if (!plugin || !plugin->hasEditor()) return;
juce::MessageManager::callAsync([this]() { if (!plugin) return;
// If window exists but hidden, just show it if (guiWindow) { // Re-apply overlay config before showing (in case Space changed) configureAsOverlayPanel(guiWindow.get()); guiWindow->setVisible(true); showWithoutFocusSteal(guiWindow.get()); return; }
auto* editor = plugin->createEditor(); if (!editor) return;
guiWindow = std::make_unique<PluginGuiWindow>(plugin->getName()); guiWindow->setContentOwned(editor, true); guiWindow->setResizable(true, true); guiWindow->centreWithSize(editor->getWidth(), editor->getHeight());
// CRITICAL: configure overlay behavior BEFORE making visible configureAsOverlayPanel(guiWindow.get());
// NOW make visible guiWindow->setVisible(true);
// Show without stealing focus from Ableton showWithoutFocusSteal(guiWindow.get()); }); // No-op — GUI is shown in-process by PluginBridgeEditor DBG("HelperPluginHost::showGui() — no-op, GUI is in-process now");}
void HelperPluginHost::hideGui(){ if (guiWindow) { juce::MessageManager::callAsync([this]() { if (guiWindow) guiWindow->setVisible(false); }); } // No-op}
// --- State ---Source/Helper/HelperPluginHost.cpp+6-103