[webkit-reviews] review granted: [Bug 136564] Use tracking areas instead of (SPI) mouse moved notifications, and follow flags changes with an event monitor : [Attachment 237671] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 5 00:51:09 PDT 2014


mitz at webkit.org <mitz at webkit.org> has granted Maciej Stachowiak
<mjs at apple.com>'s request for review:
Bug 136564: Use tracking areas instead of (SPI) mouse moved notifications, and
follow flags changes with an event monitor
https://bugs.webkit.org/show_bug.cgi?id=136564

Attachment 237671: Patch
https://bugs.webkit.org/attachment.cgi?id=237671&action=review

------- Additional Comments from mitz at webkit.org <mitz at webkit.org>
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 ^


More information about the webkit-reviews mailing list