X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f0985cf4eaec9bf271215dda5ff6795a7dfae9b5..bc63f2c969b303cf5f5e7f9adc9cd7c565f1d9b0:/src/common/popupcmn.cpp diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 143dff2635..8fc32bcc50 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -34,6 +34,8 @@ #include "wx/log.h" #endif //WX_PRECOMP +#include "wx/recguard.h" + #ifdef __WXUNIVERSAL__ #include "wx/univ/renderer.h" #include "wx/scrolbar.h" @@ -561,6 +563,16 @@ void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event) void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event) { + // we can be associated with the popup itself in which case we should avoid + // infinite recursion + static int s_inside; + wxRecursionGuard guard(s_inside); + if ( guard.IsInside() ) + { + event.Skip(); + return; + } + // let the window have it first, it might process the keys if ( !m_popup->GetEventHandler()->ProcessEvent(event) ) {