Skip to content

[Gtk4] Link click support#3249

Merged
akurtakov merged 4 commits intoeclipse-platform:masterfrom
akurtakov:master
Apr 17, 2026
Merged

[Gtk4] Link click support#3249
akurtakov merged 4 commits intoeclipse-platform:masterfrom
akurtakov:master

Conversation

@akurtakov
Copy link
Copy Markdown
Member

Implement Gtk 4 controllers handling by refactoring the non version dependent parts of Gtk 3 handling into separate methods.

Implement Gtk 4 controllers handling by refactoring the non version
dependent parts of Gtk 3 handling into separate methods.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Test Results (linux)

   94 files  ±0     94 suites  ±0   14m 1s ⏱️ -3s
4 577 tests ±0  4 357 ✅ ±0  220 💤 ±0  0 ❌ ±0 
3 335 runs  ±0  3 266 ✅ ±0   69 💤 ±0  0 ❌ ±0 

Results for commit 8176757. ± Comparison against base commit 20bb38c.

♻️ This comment has been updated with latest results.

@akurtakov
Copy link
Copy Markdown
Member Author

akurtakov commented Apr 17, 2026

The test even succeeded on gtk 4 prior to this PR due to the fact that there is synthetic event that thrigger the listener but the native signal was not handled to do so.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds GTK4 click/gesture handling to Link by refactoring the shared hit-testing and selection logic out of the GTK3 event handlers into helper methods, enabling link activation via GTK4 controllers.

Changes:

  • Refactor GTK3 button press/release and motion logic into shared handlePress, handleRelease, and handleMotion helpers.
  • Add GTK4 gesture press/release handlers to trigger link focus/activation.
  • Add GTK4 motion handler to update link hover cursor and selection drag behavior.

Comment thread bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java Outdated
Catched by review that Gtk 4 press event handling was potentially
setFocus twice.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GTK4 link click/motion support to SWT’s Link widget by refactoring shared pointer-handling logic into helper methods and wiring GTK4 gesture/motion controller callbacks alongside existing GTK3 event handlers.

Changes:

  • Refactor GTK3 press/release and motion logic into handlePress, handleRelease, and handleMotion.
  • Add GTK4 gesture press/release handlers to trigger link activation.
  • Add GTK4 motion handler to update cursor/selection behavior consistently with GTK3.

Event can't be null at this stage as it would have failed in previous
super call.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GTK4 link click/motion support in SWT Link by refactoring shared pointer-handling logic out of the GTK3 event callbacks and reusing it from GTK4 controllers.

Changes:

  • Refactor GTK3 button press/release logic into shared handlePress(...) / handleRelease(...) helpers.
  • Add GTK4 gesture press/release handlers to trigger link activation.
  • Add GTK4 motion controller handling and reuse shared hover/drag selection logic.

Comment thread bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java Outdated
If it's handled already don't bother and return.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GTK4 link click/motion support to SWT’s Link widget by introducing GTK4 controller handlers and refactoring shared pointer-handling logic into helper methods, keeping GTK3 behavior intact while enabling the GTK4 event path.

Changes:

  • Refactors GTK3 button press/release handling into version-agnostic helpers (handlePress, handleRelease).
  • Implements GTK4 gesture press/release handlers to trigger link focus/selection.
  • Implements GTK4 motion handling and shares hover/drag-selection logic via handleMotion.

@akurtakov akurtakov merged commit f51e1cd into eclipse-platform:master Apr 17, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this to Done in SWT work Apr 17, 2026
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.

3 participants