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