From: Ben Gotow Date: Fri, 22 Jan 2016 00:36:48 +0000 (-0800) Subject: Add correct window check for wheel events. See description X-Git-Tag: v0.36.6~25^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d186dceb4bf6af7917e8bd5a076859d3ab34c901;p=electron.git 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. --- diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 88476eaf..133a0e6b 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -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)