]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/popupcmn.cpp
fixing pattern phase bugs
[wxWidgets.git] / src / common / popupcmn.cpp
index 143dff26350a40d3530b6dfd1ff2597aba27c73b..8fc32bcc50f56547bc0b65627b54a40e9c64d543 100644 (file)
@@ -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) )
     {