]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/window.mm
notify the event loop that synthesized events are on the queue, wait for them to...
[wxWidgets.git] / src / osx / cocoa / window.mm
index f7c6fcb8c3d6a9d80a15577133352bc644d44a4a..0f48ef78883aa5780c5c5f0682d3d605df522549 100644 (file)
@@ -41,7 +41,7 @@
 
 // Get the window with the focus
 
-NSView* GetViewFromResponder( NSResponder* responder )
+NSView* wxOSXGetViewFromResponder( NSResponder* responder )
 {
     NSView* view = nil;
     if ( [responder isKindOfClass:[NSTextView class]] )
@@ -64,7 +64,7 @@ NSView* GetFocusedViewInWindow( NSWindow* keyWindow )
 {
     NSView* focusedView = nil;
     if ( keyWindow != nil )
-        focusedView = GetViewFromResponder([keyWindow firstResponder]);
+        focusedView = wxOSXGetViewFromResponder([keyWindow firstResponder]);
 
     return focusedView;
 }
@@ -682,6 +682,7 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve
             
             wxevent.m_wheelDelta = 10;
             wxevent.m_linesPerAction = 1;
+            wxevent.m_columnsPerAction = 1;
                 
             if ( fabs(deltaX) > fabs(deltaY) )
             {
@@ -1362,14 +1363,9 @@ bool wxWidgetCocoaImpl::resignFirstResponder(WXWidget slf, void *_cmd)
     BOOL r = superimpl(slf, (SEL)_cmd);
  
     NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder();
-    NSView* otherView = GetViewFromResponder(responder);
+    NSView* otherView = wxOSXGetViewFromResponder(responder);
 
-    wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
-    
-    // NSScrollViews can have their subviews like NSClipView getting focus
-    // therefore check and use the NSScrollView peer in that case
-    if ( otherWindow == NULL && [[otherView superview] isKindOfClass:[NSScrollView class]])
-        otherWindow = FindFromWXWidget([otherView superview]);
+    wxWidgetImpl* otherWindow = FindBestFromWXWidget(otherView);
     
     // It doesn't make sense to notify about the loss of focus if it's the same
     // control in the end, and just a different subview