X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc694caa0ad714bbcfff676d3ea85a91f8970526..caad01090aa9537446fadd3c333edb9a5ebeb310:/src/generic/listctrl.cpp?ds=sidebyside diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 4e49115d1a..7e1830b570 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1541,11 +1541,7 @@ void wxListLineData::DrawInReportMode( wxDC *dc, if (highlighted) { int flags = wxCONTROL_SELECTED; - if (m_owner->HasFocus() -#ifdef __WXMAC__ - && IsControlActive( (ControlRef)m_owner->GetHandle() ) -#endif - ) + if (m_owner->HasFocus()) flags |= wxCONTROL_FOCUSED; wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, rectHL, flags ); } @@ -3296,6 +3292,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 {