]> git.saurik.com Git - wxWidgets.git/commitdiff
avoid multiple mouse moved events, refs #15072
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 10 Mar 2013 19:02:55 +0000 (19:02 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 10 Mar 2013 19:02:55 +0000 (19:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/window.mm

index f1e8142835c0ea48c2a0a7c688914c8d1388d323..c114df5485e23fbdae86b08ce60b91ad011d5487 100644 (file)
@@ -1178,6 +1178,15 @@ typedef BOOL (*wxOSX_FocusHandlerPtr)(NSView* self, SEL _cmd);
 
 void wxWidgetCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
 {
+    // we are getting moved events for all windows in the hierarchy, not something wx expects
+    // therefore we only handle it for the deepest child in the hierarchy
+    if ( [event type] == NSMouseMoved )
+    {
+        NSView* hitview = [[[slf window] contentView] hitTest:[event locationInWindow]];
+        if ( hitview == NULL || hitview != slf)
+            return;
+    }
+    
     if ( !DoHandleMouseEvent(event) )
     {
         // for plain NSView mouse events would propagate to parents otherwise