]> khamidou — GitHub mirrors - electron.git/commitdiff
Add correct window check for wheel events. See description
authorBen Gotow <bengotow@gmail.com>
Fri, 22 Jan 2016 00:36:48 +0000 (16:36 -0800)
committerBen Gotow <bengotow@gmail.com>
Fri, 22 Jan 2016 00:36:48 +0000 (16:36 -0800)
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

index 88476eafbf543e3e59c22c76338918a1b896b855..133a0e6becc5221e743d3dc9265a27f496ae630e 100644 (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)