input/seatop_down: update touch drag focus while dragging#9182
Open
hjanuschka wants to merge 1 commit into
Open
input/seatop_down: update touch drag focus while dragging#9182hjanuschka wants to merge 1 commit into
hjanuschka wants to merge 1 commit into
Conversation
The touch drag grab in wlroots only sends wl_data_device.enter from wlr_seat_touch_point_focus() and only sends wl_data_device.motion when the drag has a focused surface. Sway never called it, so touch-initiated drags never delivered enter/motion to drop targets and the source was cancelled instead of dropped on touch up. While a touch drag is active for the moving touch point, re-pick the surface under the finger and update the touch point focus before notifying motion, mirroring what pointer drags get implicitly via wlr_seat_pointer_notify_enter().
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.
Drag-and-drop started from a touchscreen (long-press drag) never works in sway: the drag icon follows the finger, but drop targets never receive
wl_data_device.enter/motion, and on touch up the source getscancelledinstead of a drop.Root cause: wlroots' touch drag grab only emits
wl_data_device.enterfromwlr_seat_touch_point_focus(), anddrag_handle_touch_motion()only sends motion when the drag has a focused surface. Sway never callswlr_seat_touch_point_focus()anywhere, so a touch drag never gets a focus.seatop_down'shandle_touch_motion()also only forwards coordinates relative to the original surface and never re-picks what is under the finger.Fix: while a touch drag is active for the moving touch point, re-pick the surface under the finger and update the touch point focus before notifying motion. This mirrors what pointer drags get implicitly from
wlr_seat_pointer_notify_enter()on cursor motion.Related: the library-side half of this was fixed in wlroots (wlroots/wlroots#3476, "Touch DnD fixes" MR), this is the missing compositor-side half. Mutter fixed the equivalent bug recently too (mutter MR 5057), and KWin already handles touch dnd.
Tested on a touchscreen with Chromium (trying to bring touch/drag to Linux: https://crbug.com/451651623)