]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
debug handling. More broken Apple 'goodness'
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 714293fc36be981546c744ba238cc55861046c2d..111ecb19953a7dabe64cce792bb4defbef07c926 100644 (file)
@@ -442,7 +442,19 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
             if ( control == 0 )
                 currentMouseWindow = (wxWindow*) data ;
             else
+            {
                 currentMouseWindow = wxFindControlFromMacControl( control ) ;
+                if ( currentMouseWindow == NULL && cEvent.GetKind() == kEventMouseMoved )
+                {
+                       // for wxToolBar to function we have to send certaint events to it
+                       // instead of its children (wxToolBarTools)     
+                    ControlRef parent ;
+                    GetSuperControl(control, &parent );
+                    wxWindow *wxParent = wxFindControlFromMacControl( parent ) ;
+                    if ( wxParent && wxParent->IsKindOf( CLASSINFO( wxToolBar ) ) )
+                        currentMouseWindow = wxParent ;
+                }
+            }
         }        
     }