X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edf5822ace25ff6283b05e587116e49e50b77464..29c829ba84c29a33f5fac69de94513bc174e35c2:/src/osx/cocoa/window.mm diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 0bf1872401..ed40a8e054 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -1091,6 +1091,7 @@ bool wxWidgetCocoaImpl::performKeyEquivalent(WX_NSEvent event, WXWidget slf, voi wxEvtHandler * const handler = m_wxPeer->GetEventHandler(); wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command ); + command_event.SetEventObject( wxevent.GetEventObject() ); handled = handler->ProcessEvent( command_event ); if ( !handled ) @@ -1983,7 +1984,8 @@ bool wxWidgetCocoaImpl::SetFocus() if ( !CanFocus() ) return false; - [[m_osxView window] makeKeyAndOrderFront:nil] ; + // TODO remove if no issues arise: should not raise the window, only assign focus + //[[m_osxView window] makeKeyAndOrderFront:nil] ; [[m_osxView window] makeFirstResponder: m_osxView] ; return true; } @@ -2305,9 +2307,9 @@ bool wxWidgetCocoaImpl::DoHandleKeyEvent(NSEvent *event) // changed by SetupKeyEvent() so it can be wxEVT_KEY_UP too by now). if ( wxevent.GetEventType() == wxEVT_KEY_DOWN ) { - wxKeyEvent eventHook(wxevent); - eventHook.SetEventType(wxEVT_CHAR_HOOK); - if ( wxGetTopLevelParent(GetWXPeer())->OSXHandleKeyEvent(eventHook) ) + wxKeyEvent eventHook(wxEVT_CHAR_HOOK, wxevent); + if ( GetWXPeer()->OSXHandleKeyEvent(eventHook) + && !eventHook.IsNextEventAllowed() ) return true; }