Skip to content

Only call setAlwaysOnTop in showWindow when explicitly enabled#80

Open
danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
danielraffel:fix/show-window-always-on-top-guard
Open

Only call setAlwaysOnTop in showWindow when explicitly enabled#80
danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
danielraffel:fix/show-window-always-on-top-guard

Conversation

@danielraffel
Copy link
Copy Markdown
Contributor

When always_on_top_ is false (the default), showWindow() calls setAlwaysOnTop(false), which explicitly sets the window to NSNormalWindowLevel on macOS.

If Visage is hosted inside another application — for example, an audio plugin running inside a DAW — the host may have placed the window at a higher level (like a floating panel). The unconditional setAlwaysOnTop(false) demotes it to normal level, causing the Visage window to drop behind the host.

This skips the call when always_on_top_ is false, leaving the window at whatever level the host assigned. setWindowOnTop(true) still works normally for windows that should float above everything.


Discovered while working on a macOS JUCE audio plugin that uses Visage for its UI. This PR was put together with the help of Claude. Completely understand if you'd prefer to close this — just wanted to share the fix since we've been patching around it on our end whenever we update Visage.

When always_on_top_ is false (the default), calling
setAlwaysOnTop(false) explicitly sets the window to
NSNormalWindowLevel on macOS. If the window is hosted inside another
application (e.g. an audio plugin running inside a DAW), the host may
have placed the window at a higher level. The unconditional call
demotes it, causing the window to drop behind the host.

Skip the call when always_on_top_ is false so the window stays at
whatever level the host assigned. setWindowOnTop(true) still works
for windows that need to float above everything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant