Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Sources/OpenSwiftUI/View/Control/Button/AppKitButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,29 @@ extension NSButton {
var content = NSEdgeInsetsZero
Update.syncMain {
if isBordered {
#if OPENSWIFTUI_ATTRIBUTEGRAPH
if #available(macOS 26.0, *) {
// AppKit's Amber support reads system SwiftUI attributes on macOS 26+.
// OpenSwiftUI uses a separate AG namespace, so suspend dependency
// tracking during this call to avoid a cross-namespace input.
Graph.withoutUpdate {
_ = _getIntrinsicArtworkSize(
&size, alignmentRectInsets: &alignment,
idealContentInsets: &content, maxContentInsets: nil
)
}
} else {
_ = _getIntrinsicArtworkSize(
&size, alignmentRectInsets: &alignment,
idealContentInsets: &content, maxContentInsets: nil
)
}
#else
_ = _getIntrinsicArtworkSize(
&size, alignmentRectInsets: &alignment,
idealContentInsets: &content, maxContentInsets: nil
)
#endif
}
}
let alignmentInsets = EdgeInsets(top: alignment.top, leading: alignment.left, bottom: alignment.bottom, trailing: alignment.right)
Expand Down
Loading