Repository navigation
[GTK4] Fix List MouseDown and DefaultSelection - #3750
Merged
akurtakov merged 2 commits intoOct 20, 2026
Merged
Conversation
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.
There was a problem hiding this comment.
🟢 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
MouseDownhandling and click-count updates. - Sends double-click
DefaultSelectionwhen GTK activates the row. - Adds
DefaultSelectionhandling 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
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 .