Skip to content

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

Merged
raphlinus merged 1 commit intolinebender:masterfrom
Browsers-software:fix-mouse-events-on-macos13
Oct 27, 2022
Merged

Fix mouse enter/leave events on macos 13 fixes #2280#2282
raphlinus merged 1 commit intolinebender:masterfrom
Browsers-software:fix-mouse-events-on-macos13

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