Skip to content

[GTK] Send the delayed MouseDown before MouseDoubleClick on Wayland - #3749

Merged
akurtakov merged 1 commit into
eclipse-platform:masterfrom
akurtakov:wayland-double-click-drag-detect
Oct 19, 2026
Merged

akurtakov merged 1 commit into
eclipse-platform:masterfrom
akurtakov:wayland-double-click-drag-detect

Conversation

@akurtakov

Copy link
Copy Markdown
Member

On Wayland the MouseDown of the left button is held in dragDetectionQueue when the control wants drag detection, until the mouse is released or a drag starts. MouseDoubleClick was not held, so with a DragDetect listener or a DragSource the second press of a double click delivered MouseDoubleClick before MouseDown, and also before the DefaultSelection of a Table or Tree.

When MouseDoubleClick arrives, send the held MouseDown first. The queue stays for the drag detection of the press, and the MouseDown is not sent again when the queue is flushed.

On Wayland the MouseDown of the left button is held in
dragDetectionQueue when the control wants drag detection, until the
mouse is released or a drag starts. MouseDoubleClick was not held, so
with a DragDetect listener or a DragSource the second press of a double
click delivered MouseDoubleClick before MouseDown, and also before the
DefaultSelection of a Table or Tree.

When MouseDoubleClick arrives, send the held MouseDown first. The queue
stays for the drag detection of the press, and the MouseDown is not
sent again when the queue is flushed.
@akurtakov
akurtakov requested a balanced review from Copilot October 19, 2026 18:44
@akurtakov akurtakov self-assigned this Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Native event ordering and retained drag-detection state need GTK3/GTK4 Wayland runtime validation.

No open issues 🎉

What changed in this PR

Fixes GTK Wayland mouse-event ordering when drag detection delays MouseDown.

Changes:

  • Delivers the queued MouseDown before MouseDoubleClick while retaining drag-detection state.
  • Prevents duplicate MouseDown delivery when the queue is flushed.
File Description
bundles/​org.eclipse.swt/​Eclipse SWT/​gtk/​org/​eclipse/​swt/​widgets/​Control.java Tracks early MouseDown delivery and adjusts drag-queue flushing.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (linux)

   514 files  ±0     514 suites  ±0   38m 8s ⏱️ - 2m 0s
 4 807 tests ±0   4 465 ✅ ±0    342 💤 ±0  0 ❌ ±0 
14 715 runs  ±0  13 333 ✅ ±0  1 382 💤 ±0  0 ❌ ±0 

Results for commit b6f3055. ± Comparison against base commit 9990e64.

@akurtakov
akurtakov merged commit 854e4c1 into eclipse-platform:master Oct 19, 2026
18 checks passed
@akurtakov
akurtakov deleted the wayland-double-click-drag-detect branch October 23, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants