[GTK/Wayland] Fix DragDetect coordinates using mouseDown position#3193
Open
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
Open
[GTK/Wayland] Fix DragDetect coordinates using mouseDown position#3193vogella wants to merge 1 commit intoeclipse-platform:masterfrom
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
On Wayland, DragDetect was fired with the post-threshold motion coordinates instead of the original mouseDown position. This caused ctf.getItem() in Eclipse platform.ui's DnDInfo to return null when the cursor had drifted off the narrow tab label, silently aborting the drag. Fix: use the queued mouseDown event's x/y and button instead of the motion event values, matching the X11 behaviour. Fixes eclipse-platform#3192 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
Author
|
Fix patch fixes the DnD for me. |
Contributor
Test Results (linux) 85 files - 3 85 suites - 3 15m 0s ⏱️ +56s For more details on these failures, see this check. Results for commit 296eaeb. ± Comparison against base commit d820f7e. This pull request removes 1 test. |
Contributor
Author
|
Test_org_eclipse_swt_custom_BusyIndicator fail unrelated |
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.
Fixes #3192
Root cause
On Wayland, drag detection is deferred to
gtk3_motion_notify_event()because Wayland cannot deliver mouse events during the button-press handler. The originalMouseDownis queued indragDetectionQueue. When the drag threshold is exceeded,sendDragEvent()was called with the current motion event coordinates (8-12px past the click origin) instead of the original mouseDown coordinates.This caused
DragDetectEvent.x/yto be off-target. Eclipse platform.ui'sDnDInfo.update()callsctf.getItem(localPos)using those coordinates — if the cursor drifted off the narrow tab label, the lookup returnednulland the drag silently aborted.X11 is unaffected (drag detection runs inside the button-press handler and uses press coordinates directly).
Fix
In
gtk3_motion_notify_event(), usedragDetectionQueue.getFirst()for the x/y coordinates and button number instead of reading from the motion event. The state mask still comes from the motion event (valid for modifier keys). This matches X11 behaviour.Co-Authored-By: Claude Sonnet 4.6 [email protected]