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

GTK3: drag source images for tables are blurry on Wayland with fractional scaling

Abierto
#3,521 0 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
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java
Área
desktop

Línea de trabajo

Start by running the provided Java reproduction on GTK3 under Wayland at 150% or 166% scaling and inspect the SWT GTK drag-image path that creates Cairo surfaces. The issue points to missing device scale as the cause; confirm where the surface is created and how its scale is set. Done when the reproduced drag image is crisp at fractional scaling without regressing other GTK drag behavior.

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

Descripción

On Linux using GTK3, the images drawn for drag&drop operations are sometimes blurry.

Image

Apparently this is because the Cairo surfaces for drawing the images lack device scale, leading to the images having to be scaled up afterwards, rendering them blurry.

Reproduce using this snippet, running on Wayland with a fractional scale (150% or 166% for example).

import org.eclipse.swt.*;
import org.eclipse.swt.dnd.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class LinuxDndImageBlurTest {

	public static void main(String[] args) {
		final Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setText("GTK3 drag image scaling");
		shell.setLayout(new GridLayout());

		final Label instructions = new Label(shell, SWT.WRAP);
		instructions.setText("Drag a row. With display scaling above 100%, the row image is blurry.");
		instructions.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		final Table table = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);
		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
		for (int index = 1; index <= 10; index++) {
			final TableItem item = new TableItem(table, SWT.NONE);
			item.setText("Drag row " + index + " — sharp text makes scaling artifacts easy to see");
		}

		// no idea why this is somehow necessary for drag to work in this snippet
		display.addFilter(SWT.MouseDown, e -> System.err.println("MouseDown " + e));

		final DragSource dragSource = new DragSource(table, DND.DROP_COPY);

		dragSource.addDragListener(new DragSourceAdapter() {
			@Override
			public void dragSetData(DragSourceEvent event) {
				event.data = table.getSelection()[0].getText();
			}
		});

		dragSource.setTransfer(TextTransfer.getInstance());

		shell.setSize(600, 350);
		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}
}

Expected behavior
A drag image which is drawn as crisply as the row it's created from.

Lenguaje dominante
Java
Estrellas
202
Forks
206
Merge medio
16 h 56 min
PR fusionados (30 d)
110

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.