Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[GTK] Table.getClientArea reports incorrect values

Abierto
#3,294 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, linux
Área
desktop

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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:
Image
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):
Image
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:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
Lenguaje dominante
Java
Estrellas
202
Forks
206
Merge medio
20 h 20 min
PR fusionados (30 d)
113

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-platform/eclipse.platform.swt

Todos los issues de eclipse-platform/eclipse.platform.swt

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.