SWT DateTime (GTK) traps TAB traversal inside widget causing infinite internal focus cycling (day/month/year), no TRAVERSE_TAB_NEXT emitted
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- java
- 領域
- desktop-dev
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 202
- フォーク
- 206
- 平均マージ
- 16時間 56分
- マージ済み PR(30日)
- 110
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-platform/eclipse.platform.swt のほかの issue
-
`SWT_AWT.initFrame` takes `(long, String)` in Java; the GTK native declares no `className` and the Cocoa native types it `const char *`対応中かも @GreenFuze が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
eclipse-platform/eclipse.platform.swt#3665 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
eclipse-platform/eclipse.platform.swt#3336 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
メンテナーはふだん 1 日以内に返信
eclipse-platform/eclipse.platform.swt の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/rocketmq-dashboard#6716 ·
メンテナーはふだん 3 日以内に返信
-
DefaultRedisList.get(int) does not reject an index equal to the list size対応中かも @ryujungkyun が今日担当しました。 オープンstatus: waiting-for-triage
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
spring-projects/spring-data-redis#3471 ·
メンテナーはふだん 5 日以内に返信
-
:maddi-inspection-kotlin:test runs out of heap in a full maddi test run; exit 1 with no failing testオープンbuild/ci front-end:kotlin
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
uwolfer/gerrit-intellij-plugin#768 ·
メンテナーはふだん 1 日以内に返信