[GTK] Tree and table only react delayed on mouse selection if drag listener is configured
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
The report provides a Java reproduction using SWT Tree, Table, and DragSource, but names no repository files or tests. First locate the Linux GTK implementations and related selection/drag tests, then reproduce the behavior with and without the drag listener on Linux. Done means rows become visibly selected and the selection event is sent immediately in both cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Normally, a Tree or Table immediately selects a row on mouse-down. However, this is not the case any more if a drag listener is added to the tree or table.
To Reproduce
- run this snippet
import org.eclipse.swt.*;
import org.eclipse.swt.dnd.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class TreeTableDnD {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
final Tree tree = new Tree(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
for (int i = 0; i < 4; i++) {
final TreeItem item = new TreeItem(tree, 0);
item.setText("TreeItem " + i);
}
tree.addListener(SWT.Selection, e -> System.out.println("Tree selection changed"));
final Table table = new Table(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
final TableColumn column = new TableColumn(table, SWT.DEFAULT);
column.setText("Column");
column.setWidth(250);
table.setHeaderVisible(true);
for (int i = 0; i < 4; i++) {
final TableItem item = new TableItem(table, 0);
item.setText("Item " + i);
}
table.addListener(SWT.Selection, e -> System.out.println("Table selection changed"));
// new DragSource(tree, DND.DROP_MOVE).setTransfer(TextTransfer.getInstance());
// new DragSource(table, DND.DROP_MOVE).setTransfer(TextTransfer.getInstance());
shell.setSize(500, 300);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
- select a tree or table row with a slow mouse click -> the visible selection occurs immediately on mouse-down, the selection event is sent delayed
- now remove the comments to active the drag listener and try again -> the visually selection occurs delayed and the selection event even more delayed
Expected behavior
The tree and table rows get visually selected immediately and the selection event is sent immediately, independent of a drag listener.
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)
Tried on Linux Mint (X11)
- Ngôn ngữ chính
- Java
- Star
- 202
- Fork
- 206
- Merge trung bình
- 14 giờ 7 phút
- Pull request đã merge (30 ngày)
- 103
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eclipse-platform/eclipse.platform.swt
-
`SWT_AWT.initFrame` takes `(long, String)` in Java; the GTK native declares no `className` and the Cocoa native types it `const char *`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eclipse-platform/eclipse.platform.swt
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
objectionary/lints#1556 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
wildfly/wildfly-launcher#99 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/rocketmq#11427 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
A failed JNA download is reported as a corrupt zip, because `curl` in `Makefile` lacks `--fail`Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
objectionary/phino#1884 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày