X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/732b3a752b77de9ac00f770ac42b95ec99b5809d..e97251c58ea8b3676ec05ecccdcae77c61e97a10:/src/mac/carbon/toplevel.cpp?ds=inline diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 6aed596250..b9dec80021 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -181,19 +181,19 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event wxWindow* focus = wxWindow::FindFocus() ; event.SetEventObject(focus); - if ( (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey ) + if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey ) { event.m_keyCode = WXK_CONTROL ; event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; focus->GetEventHandler()->ProcessEvent( event ) ; } - if ( (modifiers ^ wxTheApp->s_lastModifiers ) & shiftKey ) + if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & shiftKey ) { event.m_keyCode = WXK_SHIFT ; event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; focus->GetEventHandler()->ProcessEvent( event ) ; } - if ( (modifiers ^ wxTheApp->s_lastModifiers ) & optionKey ) + if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & optionKey ) { event.m_keyCode = WXK_ALT ; event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; @@ -860,7 +860,9 @@ bool wxTopLevelWindowMac::Show(bool show) if (show) { - ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowShowTransitionAction,nil); + // this is leading to incorrect window layering in some situations + // ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowShowTransitionAction,nil); + ::ShowWindow( (WindowRef)m_macWindow ) ; ::SelectWindow( (WindowRef)m_macWindow ) ; // no need to generate events here, they will get them triggered by macos // actually they should be , but apparently they are not @@ -871,7 +873,9 @@ bool wxTopLevelWindowMac::Show(bool show) } else { - ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowHideTransitionAction,nil); + // this is leading to incorrect window layering in some situations + // ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowHideTransitionAction,nil); + ::HideWindow( (WindowRef)m_macWindow ) ; } if ( !show )