Fix two macOS plugin-window bugs: nil-window max dimensions, unrecorded dpi scale - #97
Open
Crandall1 wants to merge 2 commits into
Open
Fix two macOS plugin-window bugs: nil-window max dimensions, unrecorded dpi scale#97Crandall1 wants to merge 2 commits into
Crandall1 wants to merge 2 commits into
Conversation
AUv2 hosts create the plugin view before adding it to a window, so maxWindowDimensions ran with a nil window handle: messaging nil gave a 0x0 visible frame, adjustWindowDimensions clamped every size to 0x0, and clap-helpers' set_size/adjust_size cross-check terminated the process. The host then fell back to its generic editor. (cherry picked from commit 474bdaf)
The standalone constructor calls setDpiScale(scale); the parented one never did. Everything reading dpiScale() before the first backing-properties reset -- including ApplicationEditor::addToWindow pushing dpi into the frame tree -- saw 1.0, so on retina displays every plugin host laid the tree out at half scale and mouse events landed at double coordinates. The standalone was unaffected, which is why the bug only showed embedded. (cherry picked from commit 0cdc3c7)
Author
|
I didn't see #93 until just now, but it is the same as my No. 2. |
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.
Two small fixes for visage embedded as a plugin editor on macOS, found shipping a CLAP/AUv2 instrument. Both stem from the same situation: plugin views exist before the host puts them in an NSWindow, which is the normal AUv2/VST3 flow.
1.
WindowMac::maxWindowDimensionsmessages a nil windowEvery AUv2 host instantiates the plugin view before attaching it, so
[window_handle_ screen]is nil and the visible frame comes back 0x0.adjustWindowDimensionsthen clamps every size query to nothing — with clap-helpers' strict checking, the resultingset_size/adjust_sizedisagreement terminates the process. Fall back to[NSScreen mainScreen]when unattached.2. The parented
WindowMacconstructor never records its dpi scaleThe standalone constructor calls
setDpiScale(scale); the parented one drops it. Everything readingdpiScale()before the first backing-properties reset — includingApplicationEditor::addToWindowpushing dpi into the frame tree — sees 1.0, so on retina the tree lays out at half scale and mouse events land at double coordinates in every plugin host. The standalone path is unaffected, which hides the bug during development.Verified in Ableton Live 12 and Logic Pro (AUv2, retina) and against the standalone.
🤖 Generated with Claude Code