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

Fix mouse enter/leave events on macos 13 fixes #2280 #2282

Merged

Conversation

liias
Copy link
Contributor

@liias liias commented Oct 26, 2022

macOS 13 introduces an issue that mouse events are not fired anymore. This is caused by NSView.addTrackingArea being called too soon and is fixed here to be done after NSView.initWithFrame has been called.

The docs at https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TrackingAreaObjects/TrackingAreaObjects.html does say that you can create an NSTrackingArea instance and add it to a view at any point because successful creation does not depend on the view being added to a window. But it seems there are still some undocumented preconditions.

macOS 13 introduces an issue that mouse events are not fired anymore.
This is caused by `NSView.addTrackingArea` being called too soon and is fixed here to be done after `NSView.initWithFrame` has been called.

The docs at https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TrackingAreaObjects/TrackingAreaObjects.html does say that you can create an `NSTrackingArea` instance and add it to a view at any point because successful creation does not depend on the view being added to a window. But it seems there are still some undocumented preconditions.
Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

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

Thanks, from what I can tell this is a valid fix.

@raphlinus raphlinus merged commit 1cf1cd4 into linebender:master Oct 27, 2022
@liias
Copy link
Contributor Author

liias commented Oct 27, 2022

Thanks for such quick process!

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