]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
Enable UpdateUI events in wxTaskBarIcon.
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 1ce8d60fdeac9b51676956e27aaf2e8c296f6240..1fbb44d100ce2dffced576fff61a249b5bb87fcc 100644 (file)
@@ -159,8 +159,9 @@ static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , Even
 static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
 {
     OSStatus result = eventNotHandledErr ;
-
-    wxWindow* focus = wxWindow::FindFocus() ;
+    // call DoFindFocus instead of FindFocus, because for Composite Windows(like WxGenericListCtrl)
+    // FindFocus does not return the actual focus window,but the enclosing window
+    wxWindow* focus = wxWindow::DoFindFocus();
     if ( focus == NULL )
         return result ;
         
@@ -211,8 +212,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event
 
                 event.m_x = point.h;
                 event.m_y = point.v;
-                event.m_timeStamp = when;
-                wxWindow* focus = wxWindow::FindFocus() ;
+                event.SetTimestamp(when);
                 event.SetEventObject(focus);
 
                 if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey )