From d186dceb4bf6af7917e8bd5a076859d3ab34c901 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 21 Jan 2016 16:36:48 -0800 Subject: [PATCH] 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. --- atom/browser/native_window_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 88476eafbf54..133a0e6becc5 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)