Fix popup menu positioning when menu overflows below window#79
Open
danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
Open
Fix popup menu positioning when menu overflows below window#79danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
danielraffel wants to merge 1 commit intoVitalAudio:mainfrom
Conversation
When a popup menu doesn't fit below its source frame, the fallback position calculation uses `point.y` directly when a custom offset is set. This value is relative to the source frame, not the window, so the menu ends up at the wrong position (often near the top of the screen). Use window_bounds.y() consistently so the menu appears directly above the source frame regardless of whether a custom point offset was provided.
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 a popup menu doesn't fit below its source frame, the fallback position uses
point.ydirectly when a custom offset is set. Sincepoint.yis relative to the source frame rather than the window, the menu appears at the wrong position — often near the top of the screen instead of just above the trigger element.This uses
window_bounds.y()consistently so the menu appears directly above the source frame regardless of whether a custom point offset was provided.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.