From: Jaakko Salli Date: Thu, 3 Jun 2010 15:16:25 +0000 (+0000) Subject: Greatly reduce rare animation garbage in wxOwnerDrawnComboBox drop-down animation... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ce5f620a1222a5bcbafccc327522061ae07e5626 Greatly reduce rare animation garbage in wxOwnerDrawnComboBox drop-down animation (fixes #12087) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 1c49da3c2b..ae2a06e6ee 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -556,6 +556,8 @@ MSW: - Fix wxTaskBarIcon for older Windows systems (Daniel Wyatt). - 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). - Fixed wxComboCtrl::SetButtonPosition() on Vista/Win7. i18n: diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 996728d4c4..109c74cbd3 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -730,6 +730,7 @@ void wxComboCtrl::DoTimerEvent() { bool stopTimer = false; + wxWindow* win = GetPopupWindow(); wxWindow* popup = GetPopupControl()->GetControl(); // Popup was hidden before it was fully shown? @@ -741,7 +742,6 @@ void wxComboCtrl::DoTimerEvent() { wxLongLong t = ::wxGetLocalTimeMillis(); const wxRect& rect = m_animRect; - wxWindow* win = GetPopupWindow(); int pos = (int) (t-m_animStart).GetLo(); if ( pos < COMBOBOX_ANIMATION_DURATION ) @@ -759,8 +759,10 @@ void wxComboCtrl::DoTimerEvent() } 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 @@ -771,9 +773,13 @@ void wxComboCtrl::DoTimerEvent() 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