From 6eac636576ce5a49f0ef0b44dda7d0c24f96c277 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 17 Jul 2019 02:59:51 +0200 Subject: [PATCH] Fix wxListCtrl column resizing with old comctl32.dll v5 The fix for visual artefacts when resizing columns with comctl32.dll v6 introduced them when using v5 of the DLL, so apply it only conditionally now. See #18032, #18441. --- src/msw/listctrl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index a0bf23a499..dcdfa772dc 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2755,10 +2755,12 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) switch ( nmhdr->code ) { case HDN_ITEMCHANGING: - // Always let the default handling of this event take place, - // otherwise the selected items are not redrawn to correspond to - // the new column widths, see #18032. - return false; + // Always let the default handling of this event take place when + // using comctl32.dll v6, as otherwise the selected items are not + // redrawn to correspond to the new column widths, see #18032. + if ( wxApp::GetComCtl32Version() >= 600 ) + return false; + break; case LVN_DELETEALLITEMS: // always return true to suppress all additional LVN_DELETEITEM