Closed Bug 1907835 Opened 8 months ago Closed 7 months ago

PointerEvent.button still remains to be -1 for pointerdown for pens on Gtk backend

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: saschanaz, Unassigned)

References

(Blocks 1 open bug)

Details

My repro steps:

  1. Attach Wacom CTL-460 on Steam Deck
  2. Open https://patrickhlauke.github.io/touch/tracker/multi-touch-tracker-pointer-hud.html
  3. Check button value for pointerdown.

Expected: 0
Actual: -1

Flags: needinfo?(stransky)

I don't think it's a bug. That test page reacts not just to pointerdown, but also to pointerover, pointermove, pointerup, pointerout, pointercancel.

This other page is a better testcase, as this one only reacts to pointerdown: https://output.jsbin.com/rawusar/4

The .button property is only valid for events triggered by pressing or releasing such button:

This property only guarantees to indicate which buttons are pressed during events caused by pressing or releasing one or multiple buttons. As such, it is not reliable for events such as mouseenter, mouseleave, mouseover, mouseout, or mousemove.

For all other events, look at .buttons property, which is a bitmask showing the currently pressed buttons.

It's strongly recommended to refer to the spec instead of MDN for implementation bugs: https://w3c.github.io/pointerevents/#the-button-property

Indeed, I should have linked to the official specs. They say:

the button property indicates the device button whose state change fired the event

In other words, when there is a button state change (pressed or released) and that change caused a certain event, then for this event the .button property has a value. But, if there is pointermove event, it was caused by the movement of the device and not due to any button, and thus the .button property will be zero.

Assuming I understood all of this correctly, Firefox seems to be working correctly.

On the Nightly version, on the page I linked, .button is indeed 0, as expected. (Nightly is needed due to recent fixes on Pointer events. Bug 1606832) Tested on a Wacom tablet connected to a Steam Deck.

Can you please confirm if this is still a bug for you? Please remember to launch Firefox with MOZ_USE_XINPUT2=1. (Bug 1207700)

Ah, you're right, somehow I thought pointermoves should set the button property too (and I should have set the title properly for that). Then this bug is invalid with my false expectation. Sorry for the confusion/noise and thanks for the thoughtful clarification!

Status: NEW → RESOLVED
Closed: 7 months ago
Flags: needinfo?(stransky)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.