From 4f1a302221c8ecada96799bd16eb338e143d54d5 Mon Sep 17 00:00:00 2001 From: "Klare, Heiko" Date: Fri, 5 Jun 2026 12:23:39 +0200 Subject: [PATCH] [Win32] Fix tree tooltips for reordered columns When reordering columns of a tree control, wrong tooltips are shown when hovering over a cell that is too small to show the full content. Instead of the content of the actual cell at that place, the one of the cell that was originally placed at that position (without column reordering) is shown. This change corrects the index used for retrieving the tooltip content by considering the column order. --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index 13d5eae347..f8039e3828 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -5600,11 +5600,13 @@ String toolTipText (NMTTDISPINFO hdr) { RECT [] cellRect = new RECT [1], itemRect = new RECT [1]; if (findCell (pt.x, pt.y, item, index, cellRect, itemRect)) { String text = null; - if (index [0] == 0) { + int[] columnOrder = getColumnOrder(); + int orderedIndex = columnOrder.length != 0 ? columnOrder [index[0]] : index[0]; + if (orderedIndex == 0) { text = item [0].text; } else { String[] strings = item [0].strings; - if (strings != null) text = strings [index [0]]; + if (strings != null) text = strings [orderedIndex]; } //TEMPORARY CODE if (isCustomToolTip ()) text = " ";