[GTK] Table.getClientArea reports incorrect values
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start at the GTK3 implementation of Table.getClientArea() and compare how it calculates the rectangle with the behavior on Windows. Run the supplied snippet on Linux and Windows to reproduce the difference. Done means the reported rectangle has consistent bounds across the supported platforms.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The Table.getClientArea() method reports incorrect data on GTK3. The x position is wrong by one pixel and the height by approximately the table header.
To Reproduce
Launch this snippet on Windows 11 and Linux (for comparison).
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class PaintOverTable {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
final Table table = new Table(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
final TableColumn column = new TableColumn(table, SWT.LEFT);
column.setText("Column");
column.setWidth(100);
table.setHeaderVisible(true);
table.addListener(SWT.Paint, event -> {
final Rectangle clientArea = table.getClientArea();
event.gc.drawRectangle(clientArea);
});
shell.setSize(400, 300);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
On Linux the right and lower lines are visible.
Expected behavior
The reported rectangle should cover the same area on all supported platforms.
Screenshots
Windows 11:
This is reasonable, because the table header draws over the upper part and the lower and right lines are one pixel outside the visible area.
Ubuntu 26.04 (Wayland):
Notice the left line is invisible, but the right one. And the lower line is largely off by approximately the table header height.
Note, this bug is not about painting. I just used this example to illustrate the incorrect values visually.
Environment:
- Select the platform(s) on which the behavior is seen:
-
- All OS
-
- Windows
-
- Linux
-
- macOS
- Ngôn ngữ chính
- Java
- Star
- 202
- Fork
- 206
- Merge trung bình
- 16 giờ 56 phút
- Pull request đã merge (30 ngày)
- 110
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 @GreenFuze đã nhận 3 ngày trước. Đ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ự
-
agent-java community triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
elastic/apm-agent-java#4594 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/plugin good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
kestra-io/plugin-soda#137 ·
-
area/plugin good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kestra-io/plugin-aws#816 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/plugin good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
kestra-io/plugin-kestra#200 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
opensearch-project/search-relevance#618 ·
Maintainer thường phản hồi trong vòng 3 ngày