X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0756835d540c23e0103aede52b9857933f59837..69373110a5708901801ebf2c7d2d4ee76754e866:/src/mac/carbon/toplevel.cpp diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index c4cd59574e..c7c49f7f2b 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -86,12 +86,14 @@ extern long wxMacTranslateKey(unsigned char key, unsigned char code) ; static const EventTypeSpec eventList[] = { // TODO: remove control related event like key and mouse (except for WindowLeave events) -#if 1 + { kEventClassKeyboard, kEventRawKeyDown } , { kEventClassKeyboard, kEventRawKeyRepeat } , { kEventClassKeyboard, kEventRawKeyUp } , { kEventClassKeyboard, kEventRawKeyModifiersChanged } , -#endif + + { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } , + { kEventClassTextInput, kEventTextInputUpdateActiveInputArea } , { kEventClassWindow , kEventWindowShown } , { kEventClassWindow , kEventWindowActivated } , @@ -446,7 +448,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev Point screenMouseLocation = cEvent.GetParameter(kEventParamMouseLocation) ; Point windowMouseLocation = screenMouseLocation ; - WindowRef window ; + WindowRef window = NULL; short windowPart = ::FindWindow(screenMouseLocation, &window); wxWindow* currentMouseWindow = NULL ; @@ -795,12 +797,19 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand return result ; } +// mix this in from window.cpp +pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ; + pascal OSStatus wxMacTopLevelEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { OSStatus result = eventNotHandledErr ; switch ( GetEventClass( event ) ) { + case kEventClassTextInput : + result = wxMacUnicodeTextEventHandler( handler, event , data ) ; + break ; + case kEventClassKeyboard : result = KeyboardEventHandler( handler, event , data ) ; break ; @@ -1210,7 +1219,9 @@ void wxTopLevelWindowMac::MacCreateRealWindow( // the root control level handler MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() ) ; -#if TARGET_API_MAC_OSX + // Causes the inner part of the window not to be metal + // if the style is used before window creation. +#if 0 // TARGET_API_MAC_OSX if ( m_macUsesCompositing && m_macWindow != NULL ) { if ( GetExtraStyle() & wxFRAME_EX_METAL ) @@ -1405,11 +1416,11 @@ bool wxTopLevelWindowMac::IsFullScreen() const return m_macFullScreenData != NULL ; } -void wxTopLevelWindowMac::SetExtraStyle(long exStyle) +void wxTopLevelWindowMac::SetExtraStyle(long exStyle) { if ( GetExtraStyle() == exStyle ) return ; - + wxTopLevelWindowBase::SetExtraStyle( exStyle ) ; #if TARGET_API_MAC_OSX @@ -1422,8 +1433,8 @@ void wxTopLevelWindowMac::SetExtraStyle(long exStyle) #endif } +// TODO: switch to structure bounds - // we are still using coordinates of the content view -// TODO: switch to structure bounds // void wxTopLevelWindowMac::MacGetContentAreaInset( int &left , int &top , int &right , int &bottom ) {