[Gtk4] Link click support#3249
Conversation
Implement Gtk 4 controllers handling by refactoring the non version dependent parts of Gtk 3 handling into separate methods.
|
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. |
There was a problem hiding this comment.
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, andhandleMotionhelpers. - Add GTK4 gesture press/release handlers to trigger link focus/activation.
- Add GTK4 motion handler to update link hover cursor and selection drag behavior.
Catched by review that Gtk 4 press event handling was potentially setFocus twice.
There was a problem hiding this comment.
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, andhandleMotion. - 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.
There was a problem hiding this comment.
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.
If it's handled already don't bother and return.
There was a problem hiding this comment.
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.
Implement Gtk 4 controllers handling by refactoring the non version dependent parts of Gtk 3 handling into separate methods.