]> git.saurik.com Git - wxWidgets.git/commitdiff
only fowarding events if there is a focus window
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 4 Jul 2002 09:42:03 +0000 (09:42 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 4 Jul 2002 09:42:03 +0000 (09:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp
src/mac/toplevel.cpp

index 4e6f8737b833291df03dbfc4d4b6a19c7ae7d012..44af0896241b39ac646a4fc6839b91b37d5a0521 100644 (file)
@@ -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 ;
index 4e6f8737b833291df03dbfc4d4b6a19c7ae7d012..44af0896241b39ac646a4fc6839b91b37d5a0521 100644 (file)
@@ -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 ;