+#ifdef __WXGTK__
+ // ignore the next OnKillFocus() call
+ if ( time(NULL) < m_creationTime + 1 )
+ {
+ event.Skip();
+
+ return;
+ }
+#endif // __WXGTK__
+
+ // when we lose focus we always disappear - unless it goes to the popup (in
+ // which case we don't really lose it)
+ if ( event.GetWindow() != m_popup )
+ m_popup->DismissAndNotify();
+}
+
+void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event)
+{
+ // let the window have it first, it might process the keys
+ if ( !m_popup->ProcessEvent(event) )
+ {
+ // by default, dismiss the popup
+ m_popup->DismissAndNotify();
+ }