fix: set NSApplicationActivationPolicyAccessory at launch to prevent separate app appearance
Browse filesThe helper was appearing as a separate app in Dock/Cmd+Tab because
the activation policy was never being set. The showAsFloatingPanel()
only handled window level, not the application-level policy.
Now sets policy=1 (Accessory) as the FIRST thing in initialise(),
before any windows are created. This means:
- No Dock icon
- No Cmd+Tab entry
- No focus steal when helper launches
- GUI window floats over Ableton as a panel
2 unmodified lines3456789101112138 unmodified lines222324252627282930313233343536372 unmodified lines#include <juce_gui_basics/juce_gui_basics.h>#include <juce_events/juce_events.h>
#if JUCE_MAC#include <objc/objc.h>#include <objc/message.h>#endif
#include "SharedAudioBuffer.h"#include "IPCProtocol.h"#include "Constants.h"8 unmodified lines
void initialise(const juce::String& commandLine) override {#if JUCE_MAC // SET ACTIVATION POLICY BEFORE ANYTHING ELSE // Policy 1 = NSApplicationActivationPolicyAccessory // This prevents: Dock icon, Cmd+Tab entry, focus stealing on launch id nsApp = ((id(*)(id, SEL))objc_msgSend)((id)objc_getClass("NSApplication"), sel_registerName("sharedApplication")); ((void(*)(id, SEL, long))objc_msgSend)(nsApp, sel_registerName("setActivationPolicy:"), 1);#endif
auto args = juce::StringArray::fromTokens(commandLine, " ", "\"");
int parentPid = 0;Source/Helper/main.cpp+15