From 92b6cd628935cae5e41bbc1d1ead2b562c519ad2 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 19 Aug 2005 06:46:30 +0000 Subject: [PATCH] avoiding recursive KillEvents on the same object, in case the focus gets set to another element in the OnKillEvent Handler ... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 7097a160b9..a25e4b30e7 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -343,9 +343,15 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl thisWindow->GetCaret()->OnKillFocus(); } #endif // wxUSE_CARET - wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); - event.SetEventObject(thisWindow); - thisWindow->GetEventHandler()->ProcessEvent(event) ; + static bool inKillFocusEvent = false ; + if ( !inKillFocusEvent ) + { + inKillFocusEvent = true ; + wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); + event.SetEventObject(thisWindow); + thisWindow->GetEventHandler()->ProcessEvent(event) ; + inKillFocusEvent = false ; + } } else { -- 2.45.2