From 90d547feb6d0e0cc86e6b482cd9d91c852e73125 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Dec 2019 02:56:46 +0100 Subject: [PATCH] Don't redraw current cell when the grid is frozen Don't update the grid appearance when inside a sequence of batch operations, it will be updated at the end of it anyhow and doing it in the middle only results in extra flicker. --- src/generic/grid.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 6fd5207eda..d4e82b5bd7 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5759,13 +5759,16 @@ bool wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) m_currentCellCoords = coords; - wxGridCellAttr *attr = GetCellAttr( coords ); #if !defined(__WXMAC__) - wxClientDC dc( currentGridWindow ); - PrepareDCFor(dc, currentGridWindow); - DrawCellHighlight( dc, attr ); + if ( !GetBatchCount() ) + { + wxGridCellAttr *attr = GetCellAttr( coords ); + wxClientDC dc( currentGridWindow ); + PrepareDCFor(dc, currentGridWindow); + DrawCellHighlight( dc, attr ); + attr->DecRef(); + } #endif - attr->DecRef(); return true; }