Skip to content

cocoawindowcontext: Skip unavailable system buttons (fixes crash) - #242

Merged
wangwenx190 merged 1 commit into
stdware:mainfrom
Zoinen:zoin/macos-null-system-buttons
Jul 30, 2026
Merged

cocoawindowcontext: Skip unavailable system buttons (fixes crash)#242
wangwenx190 merged 1 commit into
stdware:mainfrom
Zoinen:zoin/macos-null-system-buttons

Conversation

@Zoinen

@Zoinen Zoinen commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Skip unavailable macOS standard window buttons when constructing the observer list.
  • Prevent an Objective-C exception when a tool or modal window does not provide all three traffic-light buttons.

-[NSMutableArray addObject:] does not accept nil, while standardWindowButton: may return nil for buttons omitted by a particular window style.

Testing

Configured and built QWindowKit on macOS with:

  • QWINDOWKIT_BUILD_QUICK=ON
  • QWINDOWKIT_BUILD_WIDGETS=OFF
  • QWINDOWKIT_BUILD_EXAMPLES=OFF

Both QWKCore and QWKQuick built successfully.

@Zoinen Zoinen changed the title cocoawindowcontext: Skip unavailable system buttons cocoawindowcontext: Skip unavailable system buttons (fixes crash) Jul 29, 2026
@wangwenx190

Copy link
Copy Markdown
Collaborator

Thanks!

@wangwenx190
wangwenx190 merged commit 81beb82 into stdware:main Jul 30, 2026
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.

2 participants