LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 16, 2026, 4:50 AM
updatedAtNov 16, 2026, 9:02 AM
githubUrlhttps://github.com/neomjs/neo/issues/21097
authorneo-opus-grace
commentsCount0
parentIssue21061
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 16, 2026, 9:02 AM

A click's event data omits the pointer type that produced it

Closed v14.0.0/archive-v14-0-0-chunk-3 enhancementaicore
neo-opus-grace
neo-opus-grace commented on Nov 16, 2026, 4:50 AM

Context

The web desktop (#21075, PR #21087) opens an app on a single tap on a touch device, while a mouse click only selects and a double-click opens. Emmy's review of #21087 (Request Changes, 5914795110) showed that on a touch-capable computer a mouse click opens the app too. The launcher can only consult the device flag (Neo.config.hasTouchEvents), because the click that reaches the app worker does not say which pointer produced it. In her Chromium probe the native click events did carry it: pointerType: "mouse" for a trusted mouse click and "touch" for a finger tap, in one context.

The Problem

An app that answers a tap differently from a click has no per-event signal to read, so it either guesses from the device or treats every input alike. The guess is wrong on every hybrid device: a laptop with a touch screen, a tablet with a mouse or a pen.

The Architectural Reality

  • Neo.main.DomEvents#onClick, onDoubleClick, onContextMenu and the other mouse handlers serialize the event through getMouseEventData (src/main/DomEvents.mjs). That method copies a fixed list of MouseEvent fields (altKey, button, buttons, clientX … shiftKey) and nothing else.
  • In current Chromium, click, auxclick and contextmenu are PointerEvents carrying pointerType ("mouse", "pen", "touch"). dblclick, mousedown and mouseup are plain MouseEvents without it. A browser that dispatches click as a MouseEvent carries none either.
  • The drag sensors read pointerType on the main thread (src/main/draggable/sensor/Pointer.mjs, #17889), but nothing forwards it to the app worker.

The Fix

  • getMouseEventData copies pointerType with the other fields: the event's value where it has one, and undefined where it has none, so an app can tell "no signal" from "mouse".
  • Its JSDoc names the field and the fallback a consumer needs.
  • A unit arm in test/playwright/unit/main/DomEvents.spec.mjs proves both: a click carrying pointerType: "touch" reaches the app with it, and a double-click without one reaches it with undefined.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Mouse event data sent to the app worker (Neo.main.DomEvents#getMouseEventData) the native event adds pointerType, copied from the event undefined when the event carries none (MouseEvent, older browsers) the method's JSDoc the unit arm; #21087's launcher reading it

Acceptance Criteria

  • AC-1 a click whose native event carries pointerType reaches the app worker with the same value.
  • AC-2 a mouse event without one (a dblclick, a MouseEvent click) reaches it with pointerType: undefined; every other field is unchanged.
  • AC-3 the JSDoc of getMouseEventData names the field and its fallback.

Out of Scope

  • Forwarding pointerdown / pointerup as their own app events.
  • Changing the drag sensors.
  • Any consumer change. The web desktop launcher reads the field in #21087, which carries this change.

Avoided Traps

  • Inferring the pointer from the device (Neo.config.hasTouchEvents): it is constant per device, while hybrid devices switch per event.
  • Correlating a separately forwarded pointerdown with the next click in the app: two messages, an ordering assumption and state in every consumer, for a field the click already has.

Related

Ownership: self-assigned; it unblocks #21087's required action, so it is not marked for contributors. Live latest-open + closed sweep: checked latest 20 open + open and closed search ("pointerType", "pointer type click", "click event data pointer", "click pointer touch mouse", "tap opens touch device", "getMouseEventData"; Out of Scope read on #17889) at 2026-11-16T03:49Z; no equivalent or prior exclusion found. Backlog: 65 open (red); no owning ticket exists for the engine field, and the consumer's epic is #21061. A2A claim sweep: last 30 messages at 2026-11-16T03:29Z and every unread message since, read at 03:45Z; no overlapping claim. MC sweep: "click event data has no pointer type, touch tap versus mouse click on a hybrid device", 10 results; no prior decision. The one hit is a drag-sensor lesson: read the sensor before filing. Here the serializer was read before filing. Own-assignment sweep: 11 open, none overlapping.

Origin Session ID: 7ceb0de7-6fcc-4777-879b-3a305deac77f Retrieval Hint: "click event data pointerType touch mouse hybrid device DomEvents getMouseEventData"

tobiu referenced in commit a630df9 - "feat(main): a mouse event's data carries the pointer type that produced it (#21097) (#21098)" on Nov 16, 2026, 9:02 AM