SWT DateTime (GTK) traps TAB traversal inside widget causing infinite internal focus cycling (day/month/year), no TRAVERSE_TAB_NEXT emitted
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- java
- Ambito
- desktop-dev
Direzione di ricerca
Start in org.eclipse.swt.widgets.DateTime and the GTK-specific backend code that handles key and traverse events. The bug is that TAB is consumed internally instead of being propagated as SWT.TRAVERSE_TAB_NEXT. Look for the event filter or key handling in the GTK DateTime implementation. Verify by running the SWT automated tests for DateTime and focus traversal.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When using org.eclipse.swt.widgets.DateTime on GTK (Linux), the widget consumes TAB key events internally instead of propagating them as SWT traversal events.
As a result, focus never leaves the control and TAB navigation loops between internal fields (day → month → year).
This behavior does not occur on Windows.
Environment
-
- All OS
-
- Windows
-
- Linux
-
- macOS
SWT: 3.133.0 (Eclipse 4.39)
Java: OpenJDK 25.0.3
OS: Ubuntu 26.04
Desktop: MATE
Windowing system: X11
GTK: 3.24.52
Locale: es_ES.UTF-8
(and tests in Ubuntu 26.04 Gnome and swt 3.134.0)
Steps To Reproduce
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
public class DateTimeTabDebug {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(2, false));
new Label(shell, SWT.NONE).setText("Text 1:");
Text t1 = new Text(shell, SWT.BORDER);
t1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
new Label(shell, SWT.NONE).setText("Date:");
DateTime dt = new DateTime(shell, SWT.DATE | SWT.DROP_DOWN | SWT.BORDER);
dt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
new Label(shell, SWT.NONE).setText("Text 2:");
Text t2 = new Text(shell, SWT.BORDER);
t2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
javac --release 25 \
-cp org.eclipse.swt.gtk.linux.x86_64-3.133.0.jar \
DateTimeTabDebug.java
java \
-cp .:org.eclipse.swt.gtk.linux.x86_64-3.133.0.jar \
DateTimeTabDebug
Actual Behavior
When pressing TAB:
Focus moves from Text1 → DateTime correctly
Inside DateTime:
- TAB cycles through internal fields (day → month → year)
- Focus never leaves the widget
- No focusLost event is generated
- No TRAVERSE_TAB_NEXT is received
Debug output shows repeated:
[FILTER TRAVERSE] widget=DateTime detail=0 doit=true
[DATE TRAVERSE] detail=0 doit=true
(detail=0 corresponds to SWT.TRAVERSE_NONE)
The event is repeated indefinitely.
Expected behavior
Pressing TAB inside DateTime should:
- Move focus to next control (Text2)
- Generate SWT.TRAVERSE_TAB_NEXT
- Trigger focusLost on DateTime
Same behavior as on Window
A clear and concise description of what you expected to happen.
Observed Impact
- Keyboard navigation is broken on GTK
- Focus becomes trapped inside DateTime
- Cross-platform inconsistency (Windows vs Linux)
- No reliable workaround using standard SWT listeners
Additional Notes
- TraverseListener is triggered but only with SWT.TRAVERSE_NONE (detail=0)
- KeyListener does not reliably receive TAB before GTK consumes it
- Issue reproducible in minimal SWT application
- Likely related to GTK DateTime internal editing of sub-fields
Request
Please confirm whether this is:
- a known limitation of SWT GTK DateTime, or
- a regression in SWT GTK event translation layer
and whether there is a recommended workaround or fix planned.
- Lingua principale
- Java
- Stelle
- 202
- Fork
- 206
- Merge medio
- 16h 56m
- PR unite (30g)
- 110
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di 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 *`Forse già presa @GreenFuze l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eclipse-platform/eclipse.platform.swt
Issue simili
-
agent-java community triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elastic/apm-agent-java#4594 ·
I maintainer di solito rispondono entro 1 giorno
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kestra-io/plugin-soda#137 ·
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kestra-io/plugin-aws#816 ·
I maintainer di solito rispondono entro 2 giorni
-
area/plugin good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
kestra-io/plugin-kestra#200 ·
I maintainer di solito rispondono entro 1 giorno
-
bug untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
opensearch-project/search-relevance#618 ·
I maintainer di solito rispondono entro 3 giorni