diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java index 8fe93c3c458..5001ba9b6da 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java @@ -106,9 +106,13 @@ private void markFocusedCell(Event event, ViewerCell cell) { private void removeSelectionInformation(Event event, ViewerCell cell) { GC gc = event.gc; - gc.setBackground(cell.getViewerRow().getBackground(cell.getColumnIndex())); + if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$ + // On GTK, the line is highlighted even though the SELECTED flag is removed. To + // fix this issue, the background must be overwridden + gc.setBackground(cell.getViewerRow().getBackground(cell.getColumnIndex())); + gc.fillRectangle(cell.getBounds()); + } gc.setForeground(cell.getViewerRow().getForeground(cell.getColumnIndex())); - gc.fillRectangle(cell.getBounds()); event.detail &= ~SWT.SELECTED; }