Only call setAlwaysOnTop in showWindow when explicitly enabled#80
Open
danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
Open
Only call setAlwaysOnTop in showWindow when explicitly enabled#80danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
always_on_top_isfalse(the default),showWindow()callssetAlwaysOnTop(false), which explicitly sets the window toNSNormalWindowLevelon 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_isfalse, 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.