You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Table repaint triggered from selection listener of another control is rendered incompletely while mouse button is held.
To Reproduce
/******************************************************************************* * Copyright (c) 2026 Vasili Guelvich and others * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/packageorg.eclipse.swt.snippets;
/* * Table example: repaint triggered from selection listener of another control. * * Demonstrates a bug where table repaint is rendered incompletely while the * mouse button is held down. Click and hold items in the left list and observe * the right table. * * For a list of all SWT example snippets see * http://www.eclipse.org/swt/snippets/ * * @see <a href="https://github.com/eclipse-platform/eclipse.platform.swt/issues/3311">Issue 3311</a> */importorg.eclipse.swt.*;
importorg.eclipse.swt.layout.*;
importorg.eclipse.swt.widgets.*;
publicclassSnippet395 {
publicstaticvoidmain(String[] args) {
Displaydisplay = newDisplay();
Shellshell = newShell(display);
shell.setText("Table SetInput on Selection - Bug 3311");
shell.setMinimumSize(300, 300);
shell.setLayout(newFillLayout());
String[][] data = {
{"1 very long long long long long long string 1", "2 very long long long long long long string 2"},
{"1 short string 1", "2 short string 2"},
{"3 short string 4", "4 short string 5"}
};
String[] labels = {"long values", "short values", "2 short values 2"};
String[][] currentData = {null};
Listselector = newList(shell, SWT.BORDER | SWT.SINGLE);
selector.setItems(labels);
Tabletable = newTable(shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.VIRTUAL | SWT.FULL_SELECTION);
table.addListener(SWT.SetData, event -> {
TableItemti = (TableItem) event.item;
intindex = table.indexOf(ti);
if (currentData[0] != null && index < currentData[0].length) {
ti.setText(currentData[0][index]);
}
});
selector.addListener(SWT.Selection, event -> {
display.asyncExec(() -> {
if (table.isDisposed()) return;
try {
table.setRedraw(false);
intindex = selector.getSelectionIndex();
currentData[0] = index >= 0 ? data[index] : null;
table.setItemCount(currentData[0] != null ? currentData[0].length : 0);
table.clearAll();
} finally {
table.setRedraw(true);
}
});
});
shell.setSize(400, 300);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
Click every item in left pane a few times
Click and hold every item in left pane, observe right pane
Try click-and-hold second (middle) item multiple times
Expected behavior
All items are rendered the mouse button is pushed, nothing happens when button is released.
Observed behavior
Right pane renders random prefixes of data. Lines have incomplete/truncated symbols at the end.
Rendering completes when mouse button is released.
Screenshots
Screen.Recording.2026-05-16.at.16.18.37.mov
Environment:
Select the platform(s) on which the behavior is seen:
All OS
Windows
Linux
macOS
Additional OS info (e.g. OS version, Linux Desktop, etc)
MacOS: 26.4.1 (25E253)
Describe the bug
Table repaint triggered from selection listener of another control is rendered incompletely while mouse button is held.
To Reproduce
Expected behavior
All items are rendered the mouse button is pushed, nothing happens when button is released.
Observed behavior
Right pane renders random prefixes of data. Lines have incomplete/truncated symbols at the end.
Rendering completes when mouse button is released.
Screenshots
Screen.Recording.2026-05-16.at.16.18.37.mov
Environment:
Additional OS info (e.g. OS version, Linux Desktop, etc)
MacOS: 26.4.1 (25E253)
JRE/JDK version
Version since
Unknown
Workaround (or) Additional context
Originally found in #3260
Reproduces more consistently with eGit