From 35a7f94b940c450206190b7ca2fe4135f006c46c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 8 Oct 2007 22:29:58 +0000 Subject: [PATCH] On Mac the first visible line needs to be recalculated after the Scroll because it can be set to the wrong value in Scroll because of the paint event generated by the Update() there. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 4e49115d1a..b316c39ea9 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3296,6 +3296,17 @@ void wxListMainWindow::MoveToItem(size_t item) Scroll( -1, rect.y / hLine ); if (rect.y + rect.height + 5 > view_y + client_h) Scroll( -1, (rect.y + rect.height - client_h + hLine) / hLine ); + +#ifdef __WXMAC__ + // At least on Mac the visible lines value will get reset inside of + // Scroll *before* it actually scrolls the window because of the + // Update() that happens there, so it will still have the wrong value. + // So let's reset it again and wait for it to be recalculated in the + // next paint event. I would expect this problem to show up in wxGTK + // too but couldn't duplicate it there. Perhaps the order of events + // is different... --Robin + ResetVisibleLinesRange(); +#endif } else // !report { -- 2.49.0