X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/687706f5e722ac8a39172024f794ae0ffbd190e2..544bdbbee2c81c8ab3a69e100bbd441b6461d609:/src/mac/carbon/toplevel.cpp diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index f1a4f5fd6a..d4f3e31c97 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "toplevel.h" #endif @@ -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 ; @@ -212,7 +213,6 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event event.m_x = point.h; event.m_y = point.v; event.SetTimestamp(when); - wxWindow* focus = wxWindow::FindFocus() ; event.SetEventObject(focus); if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey )