diff --git a/docs/changes.txt b/docs/changes.txt index 91c1eedd35..d4bf363d3e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -102,6 +102,8 @@ wxMSW: have more native-like focus indicator rendering. - Fixed wxOwnerDrawnComboBox keyboard handling: drop-down is no longer displayed when arrow key is pressed (without Alt). +- In some rare cases wxOwnerDrawnComboBox drop-down animation could display + as garbage. This has now been greatly reduced (mcben). 2.8.11: ------- diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index fa8e032d4c..334062c48e 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -799,6 +799,7 @@ void wxComboCtrl::OnTimerEvent( wxTimerEvent& WXUNUSED(event) ) { bool stopTimer = false; + wxWindow* win = GetPopupWindow(); wxWindow* popup = GetPopupControl()->GetControl(); // Popup was hidden before it was fully shown? @@ -810,7 +811,6 @@ void wxComboCtrl::OnTimerEvent( wxTimerEvent& WXUNUSED(event) ) { wxLongLong t = ::wxGetLocalTimeMillis(); const wxRect& rect = m_animRect; - wxWindow* win = GetPopupWindow(); int pos = (int) (t-m_animStart).GetLo(); if ( pos < COMBOBOX_ANIMATION_DURATION ) @@ -828,8 +828,10 @@ void wxComboCtrl::OnTimerEvent( wxTimerEvent& WXUNUSED(event) ) } else { - popup->Move( 0, -y ); + // Note that apparently Move() should be called after + // SetSize() to reduce (or even eliminate) animation garbage win->SetSize( rect.x, rect.y, rect.width, h ); + popup->Move( 0, -y ); } } else @@ -840,9 +842,13 @@ void wxComboCtrl::OnTimerEvent( wxTimerEvent& WXUNUSED(event) ) if ( stopTimer ) { - popup->Move( 0, 0 ); m_animTimer.Stop(); DoShowPopup( m_animRect, m_animFlags ); + popup->Move( 0, 0 ); + + // Do a one final refresh to clean up the rare cases of animation + // garbage + win->Refresh(); } } #endif