From 89e92728495341a97be57248620f5a12c1ccab1e Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Thu, 4 Jul 2002 09:42:03 +0000 Subject: [PATCH] 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 --- src/mac/carbon/toplevel.cpp | 2 +- src/mac/toplevel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ; -- 2.47.2