From: Stefan Csomor Date: Thu, 4 Jul 2002 09:42:03 +0000 (+0000) Subject: only fowarding events if there is a focus window X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/89e92728495341a97be57248620f5a12c1ccab1e only fowarding events if there is a focus window git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 4e6f8737b8..44af089624 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -252,7 +252,7 @@ pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef long keyval = wxMacTranslateKey(keychar, keycode) ; wxWindow* focus = wxWindow::FindFocus() ; - if ( wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) + if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) { // was handled internally result = noErr ; diff --git a/src/mac/toplevel.cpp b/src/mac/toplevel.cpp index 4e6f8737b8..44af089624 100644 --- a/src/mac/toplevel.cpp +++ b/src/mac/toplevel.cpp @@ -252,7 +252,7 @@ pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef long keyval = wxMacTranslateKey(keychar, keycode) ; wxWindow* focus = wxWindow::FindFocus() ; - if ( wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) + if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) { // was handled internally result = noErr ;