Use tracking areas instead of (SPI) mouse moved notifications, and follow flags changes with an event monitor
Created attachment 237671 [details] Patch
Attachment 237671 [details] did not pass style-queue: ERROR: Source/WebKit/mac/WebView/WebHTMLView.mm:1780: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebKit/mac/WebView/WebHTMLView.mm:4216: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 2 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 237671 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=237671&action=review > Source/WebKit/mac/ChangeLog:13 > + * WebKit.order: Remove reference to obsolete call. There’s no need to update this file. > Source/WebKit/mac/WebView/WebHTMLView.mm:617 > + id _flagsChangedEventMonitor; Might be best to be consistent with the majority of ivars in this class and remove the underscore. > Source/WebKit/mac/WebView/WebHTMLView.mm:1001 > + NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] mouseLocationOutsideOfEventStream] > + modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber] > + context:[flagsChangedEvent context] eventNumber:0 clickCount:0 pressure:0]; > + > + // Pretend it's a mouse move. > + [self mouseMoved:fakeEvent]; This code is just moving around, but if you wanted you could rewrite it with dot syntax for property access and remove the not-so-helpful comment. > Source/WebKit/mac/WebView/WebHTMLView.mm:3152 > + _private->_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) > + { The opening brace for a block goes on the same line as the ^
Committed r173309: <http://trac.webkit.org/changeset/173309>
Landed with all suggested changes (except that I left in the removal from WebKit.order; I know it won't make any difference to the code but it makes it more convenient to not get false-positive search hits for removed symbols).
Committed iOS build fix in <http://trac.webkit.org/changeset/173315>.
Committed additional iOS build fixes in <http://trac.webkit.org/changeset/173316> and <http://trac.webkit.org/changeset/173317>.