diff --git a/include/wx/combo.h b/include/wx/combo.h index b991ad7aa9..cfb202be2b 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -142,6 +142,7 @@ struct wxComboCtrlFeatures class WXDLLIMPEXP_CORE wxComboCtrlBase : public wxControl { friend class wxComboPopup; + friend class wxComboPopupEvtHandler; public: // ctors and such wxComboCtrlBase() : wxControl() { Init(); } diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 10e0da7dcd..a050bd6cf2 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -760,6 +760,12 @@ void wxComboPopupEvtHandler::OnMouseEvent( wxMouseEvent& event ) // block this one) m_blockEventsToPopup = false; event.Skip(false); + + // Also, this button press was (probably) used to display + // the popup, so relay it back to the drop-down button + // (which supposedly originated it). This is necessary to + // refresh it properly. + relayToButton = true; } } else if ( m_blockEventsToPopup ) @@ -789,12 +795,14 @@ void wxComboPopupEvtHandler::OnMouseEvent( wxMouseEvent& event ) if ( relayToButton ) { - wxWindow* eventSink = m_combo; wxWindow* btn = m_combo->GetButton(); if ( btn ) - eventSink = btn; - - eventSink->GetEventHandler()->ProcessEvent(event); + btn->GetEventHandler()->ProcessEvent(event); + else + // Bypass the event handling mechanism. Using it would be + // confusing for the platform-specific wxComboCtrl + // implementations. + m_combo->HandleButtonMouseEvent(event, 0); } }