From: Vadim Zeitlin Date: Wed, 14 Jul 2010 14:52:28 +0000 (+0000) Subject: Don't use wxRendererNative::DrawFocusRect() under Mac. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/705c4d13d9fe789db114bd8116186a268b819b62 Don't use wxRendererNative::DrawFocusRect() under Mac. This function doesn't do the right thing there, it draws the focus border as it's drawn around controls such as buttons. This border overflows the item rectangle and results in garbage remaining on screen when selection changes. See #12229. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index e52de848c4..c9915b198e 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2114,6 +2114,10 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) } } + // DrawFocusRect() is unusable under Mac, it draws outside of the highlight + // rectangle somehow and so leaves traces when the item is not selected any + // more, see #12229. +#ifndef __WXMAC__ if ( HasCurrent() ) { int flags = 0; @@ -2123,6 +2127,7 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxRendererNative::Get(). DrawFocusRect(this, dc, GetLineHighlightRect(m_current), flags); } +#endif // !__WXMAC__ } void wxListMainWindow::HighlightAll( bool on )