My iPad Drag Reached the Mac as a Pointer-Down

2026-12-03来源 dev.toEnglish

Originally published on hexisteme notes.

I dragged a finger across a Mac desktop displayed on an iPad. The desktop was fitted to the screen and nothing moved. In the Mac's browser log, however, something had happened. Safari received a pointer-down aimed at no useful target. It received no wheel event from the short drag.

A screen recording of the iPad would have made this look like a dead scroll gesture. The browser log showed a more specific problem. An input meant to scroll one panel had crossed the connection as the start of a click. Whether it appeared harmless depended on what happened to be under the finger.

Same finger, different viewer mode

The viewer can display a single Mac window or the whole desktop. In a selected window, a one-finger drag in direct-touch mode already scrolled the content under the finger. In the full-desktop view the gesture could be used to pan the local viewport. That's useful when the view is zoomed in. At fit scale there was nowhere for it to pan. A short movement could also meet the tap recognizer's threshold and send a press to the host.

Moving the local viewport and scrolling the remote document are both reasonable responses to a finger moving across glass. They have different owners. For a reader at the bottom of a long panel, moving the client's viewport around the monitor won't reveal the rest of that document. The Mac application has to receive a scroll, and the scroll has to land over that panel.

I changed the full-desktop input routing to use the same direct-touch capability check as the selected-window path. A touch-capable host gets one-finger scrolling anchored to the point first touched. Two fingers are assigned to moving or scaling the local view. View-only sessions and older hosts without touch support retain one-finger local panning. The host already understood a scroll at desktop coordinates, so the change belonged in the viewer.

Give the wrong panel somewhere to scroll

I tested the path on a physical iPad against a Safari page on the Mac. The page had independently scrollable left and right panels and a field that could receive focus. It recorded each panel's scroll offset along with wheel events, their target panel, pointer-downs and focus. Having two scrollable panels lets the test detect a coordinate error even when the host receives a perfectly good wheel event.

These are the relevant observations from the final device run, in order.

Action Mac Safari observation
Start the fixture Left and right offsets both read 360.
Drag on the right panel One trusted wheel on the right. The right offset reached 432 and the left stayed at 360.
Tap the field A pointer-down targeted the field, followed by focus.
Touch the viewer to dismiss the keyboard No additional pointer-down appeared on the Mac.

The page also records a sequence number with each event. The verifier starts at the last fixture load and checks that the sequence is continuous. Otherwise a wheel from a previous attempt could make a broken drag pass, or a gap in the log could hide the extra press we're looking for. The field press gives the verifier a boundary within that sequence. The wheels that count for the drag must arrive before it.

I wouldn't encode 432 as the definition of success. It describes this run. The regression check asks whether the right panel moved enough to demonstrate scrolling while the left kept its original offset. It also checks where the wheel events landed. A handler that moves the right panel programmatically could satisfy an offset-only assertion. A handler that dispatches a wheel without moving any content could satisfy an event-only assertion. The fixture checks both consequences.

The intentional field tap is a useful control. Disabling remote pointer input altogether would make the unwanted press disappear. It would also prevent the field from receiving focus. Playing the gestures in sequence distinguishes a fix for the drag from a viewer that has quietly stopped sending clicks.

The next tap belongs to the keyboard

When the iPad keyboard is open, a touch on the remote view has another local job. It dismisses the keyboard. Forwarding that same touch to the Mac would let the user press whatever happened to be behind it. In the device run, the view dismissed the keyboard and the field tap remained the only pointer-down recorded on the Mac.

For an ordinary unsent draft, dismissing the keyboard leaves the text in the input bar. If a Mac field is being edited, the existing finish-editing path can send the remaining text. That's why the device assertion is phrased narrowly. It promises no extra pointer-down from the dismissal gesture. It doesn't promise an idle connection while a remote edit finishes.

The simulator regression for full-desktop dragging failed before the change and passed afterward. On the physical iPad the receiving page supplied evidence for the one-finger route. Zoomed two-finger panning on that device and the physical iPhone path were still untested in this run. Neither path has a device trace from this run.

If I had only the client screenshot, I could say the page looked still before the fix and moved afterward. With the host trace I can say which panel moved, which event reached it, and which later touch the Mac should never see. Those are concrete assertions I can keep when the viewer UI changes again.

Email list for these notes: hexisteme.beehiiv.com — no issue has gone out yet, so you would be on it before the first one. No welcome sequence, no course, no upsell.

More notes at hexisteme.github.io/notes.

原文:https://www.a8q9.cn/en/article/my-ipad-drag-reached-the-mac-as-a-pointer-down-4afb72.html

相关文章