fix: GUI now floats over Ableton in fullscreen mode
Browse filesRoot cause: NSWindow needs collection behavior flags to appear in
fullscreen Spaces. Without them, macOS puts the window in a separate
Space (different desktop), causing the 'opens in new window' behavior.
Fix adds to showAsFloatingPanel():
- canJoinAllSpaces (1 << 0) — window can appear on any Space
- fullScreenAuxiliary (1 << 8) — window can overlay fullscreen apps
- Window level raised to 25 (NSStatusWindowLevel) which is above
fullscreen app level
This means the plugin GUI will float over Ableton whether Ableton
is windowed OR fullscreen.
9 unmodified lines1011121314151 unmodified line171819202122232425264 unmodified lines2902912922932942952969 unmodified lines#endif// Show window as floating panel without activating this app or stealing focusstatic void showAsFloatingPanel(juce::Component* window){#if JUCE_MAC1 unmodified line{auto* nsWindow = (id)peer->getNativeHandle();// Set window level to floating (above normal windows)// NSFloatingWindowLevel = 3((void(*)(id, SEL, long))objc_msgSend)(nsWindow, sel_registerName("setLevel:"), 3);// Don't hide on deactivate (stay visible when helper loses focus)((void(*)(id, SEL, int))objc_msgSend)(nsWindow, sel_registerName("setHidesOnDeactivate:"), 0);264 unmodified linesguiWindow->centreWithSize(editor->getWidth(), editor->getHeight());guiWindow->setVisible(true);// Make it float without stealing focusshowAsFloatingPanel(guiWindow.get());});}9 unmodified lines101112131415161 unmodified line1819202122232425262728293031323334264 unmodified lines2993003013023033043059 unmodified lines#endif// Show window as floating panel without activating this app or stealing focus// Works in BOTH windowed and fullscreen modestatic void showAsFloatingPanel(juce::Component* window){#if JUCE_MAC1 unmodified line{auto* nsWindow = (id)peer->getNativeHandle();// --- COLLECTION BEHAVIOR (critical for fullscreen) ---// canJoinAllSpaces = 1 << 0 (window appears on ALL Spaces/desktops)// fullScreenAuxiliary = 1 << 8 (window can float over fullscreen apps)// Combined = 257long behavior = (1 << 0) | (1 << 8);((void(*)(id, SEL, long))objc_msgSend)(nsWindow, sel_registerName("setCollectionBehavior:"), behavior);// --- WINDOW LEVEL ---// NSStatusWindowLevel = 25 (above fullscreen apps)// NSFloatingWindowLevel = 3 is NOT enough — fullscreen apps are higher((void(*)(id, SEL, long))objc_msgSend)(nsWindow, sel_registerName("setLevel:"), 25);// Don't hide on deactivate (stay visible when helper loses focus)((void(*)(id, SEL, int))objc_msgSend)(nsWindow, sel_registerName("setHidesOnDeactivate:"), 0);264 unmodified linesguiWindow->centreWithSize(editor->getWidth(), editor->getHeight());guiWindow->setVisible(true);// Make it float without stealing focus — works in windowed AND fullscreenshowAsFloatingPanel(guiWindow.get());});}
Source/Helper/HelperPluginHost.cpp+13-4