Skip to content

[GTK4] Fix List MouseDown and DefaultSelection - #3750

Merged
akurtakov merged 2 commits into
eclipse-platform:masterfrom
akurtakov:gtk4-list-mousedown
Oct 20, 2026
Merged

akurtakov merged 2 commits into
eclipse-platform:masterfrom
akurtakov:gtk4-list-mousedown

Conversation

@akurtakov

Copy link
Copy Markdown
Member

List.gtk_gesture_press_event returned without calling super for the
first press, so a click on a List sent no MouseDown. It also left the
click count of an earlier double click in place, so the MouseUp of the
next single click had count 2.

GtkTreeView activates the row in its own click gesture, which runs after
the one of SWT, so the first double click sent no DefaultSelection, and
the stale rowActivated flag made a later double press send one even when
no row was activated. As Table does on GTK4, remember a double press and
send the DefaultSelection from gtk_row_activated, and send it for Enter
and keypad Enter as well.

To reproduce on GTK4: add MouseDown, MouseUp, Selection and
DefaultSelection listeners to a List, click an item, then double click
an item and press Enter.

Part of #3743 .

List.gtk_gesture_press_event returned without calling super for the
first press, so a click on a List sent no MouseDown. It also left the
click count of an earlier double click in place, so the MouseUp of the
next single click had count 2.

Part of eclipse-platform#3743.
GtkTreeView activates the row in its own click gesture, which runs after
the one of SWT, so rowActivated was still false when the second press
was handled and the first double click sent no DefaultSelection. The
flag then stayed set, and the next double press sent a DefaultSelection
even when no row was activated.

As Table does on GTK4, remember a double press and send the
DefaultSelection from gtk_row_activated. Send it for Enter and keypad
Enter as well, and do not let a keyboard activation use a pending
double press.

Part of eclipse-platform#3743.

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.

🟢 Approval recommended

The focused changes follow established GTK4 handling patterns, with no unresolved blocking findings.

No open issues 🎉

What changed in this PR

Fixes GTK4 List mouse and activation events while preserving GTK3 behavior.

Changes:

  • Restores first-click MouseDown handling and click-count updates.
  • Sends double-click DefaultSelection when GTK activates the row.
  • Adds DefaultSelection handling for Enter and keypad Enter.
File Description
bundles/​org.eclipse.swt/​Eclipse SWT/​gtk/​org/​eclipse/​swt/​widgets/​List.java Corrects GTK4 click handling and row activation event timing.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (linux)

   514 files  ±0     514 suites  ±0   36m 19s ⏱️ -31s
 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 a2e9194. ± Comparison against base commit 854e4c1.

@akurtakov
akurtakov merged commit 54869aa into eclipse-platform:master Oct 20, 2026
18 checks passed
@akurtakov
akurtakov deleted the gtk4-list-mousedown 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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants