Reproduce steps: 1. create a wkwebview and navigate to google.com 2. Move mouse within the WkWebView 3. print the event type in `sendEvent:` of subclassing NSApplication Expect: NSEventTypeMouseExited don't be triggerred. Actual: NSEventTypeMouseExited be trigger multiple times.
Thank you for the report. What makes you expect that NSEventTypeMouseExited won't be dispatched on NSApplication? AFAICT it's used for NSTrackingArea.
Thanks @Alexey for the quick reply. IIUC, NSEventTypeMouseExited only be triggerred when uses exit a NSView? If uses only move mouse inside the WKWebView, I think it should not be triggerred.
It would seem fair to expect this for events sent to the view, but not for everything dispatched through NSApplication.
Sorry, I didn't get you. When I move mouse within WKWebView(e.g move out from <input> element), `sendEvent:` of subclassing NSApplication is called with `mouseExited`. It can definitely mean that the user move out of some NSTracking area, right? My guess is that there are many tracing area in one WKWebView, e.g one tracking are per one button/input. If so, That explains my question. But according to WKWebView source code, I found it seems that there is only one NSTracking area for WKWebView. https://github.com/WebKit/WebKit/blob/164aa4e39b317d71cbd408dcaa124282838b4d2f/Source/WebKit/UIProcess/mac/WebViewImpl.mm#L1158
You can ask this question in Cocoa programming groups, or use a debugger to discover why it't being sent. There is no indication of a problem that needs to be fixed here.