Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor macOS to use new objc2 features #2465

Merged
merged 9 commits into from
Sep 8, 2022
Merged

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Sep 2, 2022

The final part of #2427, for now. I'll still work some more on things (namely main thread safety, see #2464), but this PR is a huge step up in safety and ease-of-maintenance.

Concretely:

  • Move bindings into appkit module that exposes a safe API around (almost) all message sending
  • Use objc2's ivar mechanism, which is just magnitudes better than the with_state functions we did before
  • Use objc2::foundation which contains safe interfaces to common stuff like NSString, NSArray, ...
  • Remove cocoa dependency

Checklist:

  • Tested on all platforms changed

@madsmtm madsmtm added DS - macos S - maintenance Repaying technical debt labels Sep 2, 2022
@madsmtm madsmtm added this to the Version 0.28 milestone Sep 2, 2022
@madsmtm madsmtm mentioned this pull request Sep 2, 2022
8 tasks
@madsmtm madsmtm force-pushed the macos-refactor-unsafe branch 2 times, most recently from 5c72c34 to ec25dd7 Compare September 2, 2022 22:05
The compiler fence is safe to get rid of now since `interpretKeyEvents` takes `&mut self`
@madsmtm madsmtm removed the request for review from francesca64 September 2, 2022 22:23
@madsmtm madsmtm changed the title Refactor macOS Refactor macOS to use new objc2 features Sep 3, 2022
@madsmtm madsmtm merged commit 340f951 into master Sep 8, 2022
@madsmtm madsmtm deleted the macos-refactor-unsafe branch September 8, 2022 14:45
@madsmtm madsmtm mentioned this pull request Nov 30, 2022
1 task
@madsmtm madsmtm mentioned this pull request Aug 27, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - macos S - maintenance Repaying technical debt
Development

Successfully merging this pull request may close these issues.

1 participant