Add correct window check for wheel events. See description

Tested that with two windows, events are fired on the correct BrowserWindow instance and not both, and that scrolling a window which is in the background works properly.
This commit is contained in:
Ben Gotow 2016-01-21 16:36:48 -08:00
parent e96e674201
commit d186dceb4b

View file

@ -494,7 +494,7 @@ NativeWindowMac::NativeWindowMac(
event_monitor_.reset([[NSEvent
addLocalMonitorForEventsMatchingMask:NSScrollWheelMask
handler:^NSEvent * _Nullable(NSEvent * event) {
if (![window_ isKeyWindow])
if ([[event window] windowNumber] != [window_ windowNumber])
return event;
if (!web_contents)