Skip to content

Fix macOS build failure with older SDKs in QuartzWindow.mm#21282

Open
chrisburr wants to merge 1 commit intoroot-project:masterfrom
chrisburr:fix/cocoa-clipsToBounds-older-sdk
Open

Fix macOS build failure with older SDKs in QuartzWindow.mm#21282
chrisburr wants to merge 1 commit intoroot-project:masterfrom
chrisburr:fix/cocoa-clipsToBounds-older-sdk

Conversation

@chrisburr
Copy link
Contributor

NSView.clipsToBounds is not declared in NSView.h in older macOS SDKs such as MacOSX11.0.sdk. This causes a build failure when compiling with these SDKs, as used by conda-forge:

QuartzWindow.mm:2618:10: error: property 'clipsToBounds' not found on object of type 'QuartzView *'
 2618 |     self.clipsToBounds = YES;
      |          ^
QuartzWindow.mm:2624:10: error: property 'clipsToBounds' not found on object of type 'QuartzView *'
 2624 |     self.clipsToBounds = self.subviews.count > 1;
      |          ^
2 errors generated.

Failing conda-forge build: conda-forge/root-feedstock#335

This PR replaces self.clipsToBounds = <value> with the equivalent self.layer.masksToBounds = <value>, guarded by self.wantsLayer = YES to ensure the view is layer-backed. layer.masksToBounds is the Core Animation equivalent and is available across all SDK versions.

Additionally, the overridden didAddSubview: and willRemoveSubview: methods now call their super implementations, which is standard practice when overriding these NSView methods.

chrisburr added a commit to chrisburr/root-feedstock that referenced this pull request Feb 15, 2026
@chrisburr chrisburr marked this pull request as ready for review February 15, 2026 03:56
@chrisburr chrisburr requested a review from couet as a code owner February 15, 2026 03:56
@dpiparo
Copy link
Member

dpiparo commented Feb 15, 2026

Thanks. Starting the tests.

@github-actions
Copy link

Test Results

    22 files      22 suites   3d 5h 54m 12s ⏱️
 3 791 tests  3 791 ✅ 0 💤 0 ❌
75 369 runs  75 369 ✅ 0 💤 0 ❌

Results for commit eb3136f.

@vepadulano
Copy link
Member

@chrisburr thank you for this PR!

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.

3 participants