Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,521 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java
Ambito
desktop

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
202
Fork
206
Merge medio
14h 7m
PR unite (30g)
103

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-platform/eclipse.platform.swt

Tutte le issue di eclipse-platform/eclipse.platform.swt

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.