X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06077aaf2c11135bb9ca18ef33181ab18ac7480e..74b357dddeb8c2d859f0970c6c3be08b3524f4e7:/src/common/popupcmn.cpp diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index d0a3534f37..8fc32bcc50 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -34,8 +34,11 @@ #include "wx/log.h" #endif //WX_PRECOMP +#include "wx/recguard.h" + #ifdef __WXUNIVERSAL__ #include "wx/univ/renderer.h" + #include "wx/scrolbar.h" #endif // __WXUNIVERSAL__ #ifdef __WXGTK__ @@ -560,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) ) {