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

feat: Workaround for libraries that put the macOS keyboard focus on the window rather than the content view #266

Merged
merged 4 commits into from
Aug 7, 2023

Conversation

mwcampbell
Copy link
Contributor

This fixes the macOS focus problem discussed in #250.

@madsmtm I had to copy some code from objc2 in order to add a method to an existing class. That was the only solution I could find; creating a subclass and changing the class of the window instance led to very broken behavior (the window never appeared), likely because NSWindow uses KVO.

platforms/macos/src/patch.rs Show resolved Hide resolved
platforms/macos/src/patch.rs Outdated Show resolved Hide resolved
bindings/c/src/macos.rs Show resolved Hide resolved
Copy link
Member

@DataTriny DataTriny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to let macOS experts have a close look at this one!

platforms/macos/src/patch.rs Outdated Show resolved Hide resolved
@mwcampbell mwcampbell merged commit c2db1b0 into main Aug 7, 2023
5 checks passed
@mwcampbell mwcampbell deleted the window-class-focus-forwarder branch August 7, 2023 21:47
@mwcampbell mwcampbell mentioned this pull request Aug 2, 2023
@mwcampbell
Copy link
Contributor Author

Mads said it was fine, so I've gone ahead and merged it.

lunixbochs pushed a commit to talonvoice/accesskit that referenced this pull request Aug 31, 2023
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