[GTK] GC.copyArea from a display GC returns stale pixels at GDK_SCALE=2
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start from the GTK port's GC.copyArea(Image, int, int) implementation (the SWT GTK native/OS layer where gdk_cairo_set_source_window paints the root window), and compare it with the working gdk_pixbuf_get_from_window path plus how GDK_SCALE=2 scale factors feed the cairo source. Reproduce with the issue's snippet under Xvfb with GDK_SCALE=2 and 1. Done means the snippet returns current pixels at scale 2 while scale-1 behavior stays unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On GTK with GDK_SCALE=2, GC.copyArea(Image, x, y) on a display GC returns the first read of a screen area again for every later read of the same area.
A shell opened after the first read is missing from the copy, and a shell closed later stays in it.
A read of a different area is current, and gdk_pixbuf_get_from_window on the root window returns the current pixels for the same area.
At scale 1 everything is current.
Snippet:
Display display = new Display();
Shell red = new Shell(display);
red.setBackground(display.getSystemColor(SWT.COLOR_RED));
red.setBounds(0, 0, 1000, 700);
red.open();
pump(display, 1500);
copy(display); // red, as expected
Shell blue = new Shell(display);
blue.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
blue.setBounds(100, 100, 400, 300);
blue.open();
pump(display, 1500);
copy(display); // pixel at (200,200) is still red, expected blue
static void pump(Display display, int millis) throws InterruptedException {
long end = System.currentTimeMillis() + millis;
while (System.currentTimeMillis() < end) {
if (!display.readAndDispatch()) {
Thread.sleep(10);
}
}
}
static int copy(Display display) {
Image image = new Image(display, 1000, 700);
GC gc = new GC(display);
gc.copyArea(image, 0, 0);
gc.dispose();
ImageData data = image.getImageData(display.getPrimaryMonitor().getZoom());
image.dispose();
return data.getPixel(400, 400);
}
Seen on Linux X11 (Xvfb 3200x2000, dpi 192, GDK_SCALE=2) with the SWT of Eclipse 4.41 (2026-09).
Waiting, flushing and marking the GC's cairo target dirty do not help.
copyArea(Image, int, int) paints the root window through gdk_cairo_set_source_window, which looks like the cached path.
Reading through gdk_pixbuf_get_from_window instead works around it.
- Lenguaje dominante
- Java
- Estrellas
- 202
- Forks
- 206
- Merge medio
- 16 h 56 min
- PR fusionados (30 d)
- 110
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de 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 *`Posiblemente ocupada @GreenFuze la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
Los mantenedores suelen responder en 1 día
Todos los issues de eclipse-platform/eclipse.platform.swt
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
scylladb/scylla-cdc-source-connector#350 ·
Los mantenedores suelen responder en 1 día
-
agent:working documentation enhancement go:build lane:needs-decision
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Sanne/incus-spawn#1435 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
area:shuffle bug priority:high requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/datafusion-comet#7062 ·
Los mantenedores suelen responder en 1 día
-
wait for review
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue up-for-grabs
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
AnikethTS/ChangeRadar#22 ·
Los mantenedores suelen responder en 1 día