Open Bug 1583480 Opened 5 years ago Updated 1 year ago

PointerEvent.pointerId does not persist on Wacom tablet with Windows Ink disabled

Categories

(Core :: DOM: Events, defect, P3)

71 Branch
Desktop
Windows 10
defect

Tracking

()

UNCONFIRMED

People

(Reporter: aleksandar.xyz, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36

Steps to reproduce:

Go to https://output.jsbin.com/xeqirejazu and pay attention to the printed pointerId number in document body.

Notice that when using wacom stylus, the number changes with each pointer event while mouse and touchpad display 0.

Actual results:

Firefox does not track pointerID correctly when using wacom stylus (and possibly other).

Expected results:

pointerId should be consistent like in other browsers.

You can see the source code of the bug demo here: https://jsbin.com/xeqirejazu/1/edit?js,output

OS: Unspecified → Windows 10
Hardware: Unspecified → Desktop
Version: 69 Branch → 71 Branch

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → DOM: Events
Product: Firefox → Core
Blocks: 822898
Priority: -- → P3

I can confirm pointerId keeps changing (Firefox 69, Win 7, Wacom Intuos 4), and would like to see this fixed. Thanks.

Blocks: 1631377
No longer blocks: 822898

Is this really an issue? The id also increases on Chrome/Edge when the pen pointer appears and disappears (by putting the pen on/removing from the display), and the spec says the id selection algorithm is implementation defined. I'm inclined to close this, do you have any objection?

Flags: needinfo?(echen)

(In reply to benni.vetter from comment #3)

I can confirm pointerId keeps changing (Firefox 69, Win 7, Wacom Intuos 4), and would like to see this fixed. Thanks.

How does Chrome behave with the Wacom stylus? On Surface Pro, Chrome/Edge also increases the pointer id when pen pointer re-appears on the display).

Flags: needinfo?(aleksandar.xyz)
Flags: needinfo?(benni.vetter)

Is this really an issue?
It definitely is.

I think there is some misunderstanding about this bug. The issue is NOT that pointerId changes between individual pointer gestures. If the pointer leaves the window and has a different pointerId during subsequent gestures that is OK.

Thus bug is that pointerId changes 120 TIMES PER SECOND during the same pointer gesture. It happens only on firefox on Windows (tested with wacom tablet with Windows Ink disabled).

Flags: needinfo?(aleksandar.xyz)

Sorry about phone recording but here is demonstration of the bug: https://photos.app.goo.gl/J6ajFHVuR2Gn4EdE7

Thanks for the video. What happens when you enable Windows Ink?

Flags: needinfo?(aleksandar.xyz)

With Windows in it works as expected. pointerId does not change.

Flags: needinfo?(aleksandar.xyz)
Summary: PointerEvents: event.pointerId incorrect when using stylus → PointerEvent.pointerId does not persist on Wacom tablet with Windows Ink disabled

Thanks! I guess we need a Wacom tablet to reproduce this.

Flags: needinfo?(echen)
Flags: needinfo?(benni.vetter)

I tried it again with an intuos 4 in Windows 10 (previously Windows 7). It behaves as in aleksandar's video.

There is an experimental flag named dom.w3c_pointer_events.dispatch_by_pointer_messages in about:config. Could you try enabling it and see it still happens? (Please disable it after testing as it has known issues yet.)

Flags: needinfo?(benni.vetter)
Flags: needinfo?(aleksandar.xyz)

(In reply to Kagami :saschanaz from comment #12)

There is an experimental flag named dom.w3c_pointer_events.dispatch_by_pointer_messages in about:config. Could you try enabling it and see it still happens? (Please disable it after testing as it has known issues yet.)

Sure! It still happens with the flag enabled. (I restarted firefox after changing the flag)

Flags: needinfo?(benni.vetter)

Thanks for the quick check!

Flags: needinfo?(aleksandar.xyz)

I'm still seeing this issue. pointerdown and pointerup events say the pointerId is different even though they're marked isPrimary

Severity: normal → S3

I would like to add that it seems that the generated pointer events "jitter". When moving the pointer very fast I noticed that they seem to fire in incorrect order, which might be related to this bug - something like 2, 1, 4, 3, 6, 5, 8, 7, ... - so the pointer moves forward, a bit back, forward and back again ad infinitum.
see: https://user-images.githubusercontent.com/40297338/204004058-666c9d29-ee09-4e51-bcd1-6c39a794b540.png

Found a strange behavior on https://patrickhlauke.github.io/touch/tracker/tracker-force-pressure.html and after some digging nailed it to pointerId. But it appears the bug is reported for 4 years ago, huh.

Steps to reproduce:

  1. Have Wacom tablet
  2. Disable Windows Ink in Wacom driver
  3. Open https://patrickhlauke.github.io/touch/tracker/tracker-force-pressure.html and move a pen over a tablet

Actual behavior:

see long tail: https://i.imgur.com/Sausw3M.gif

Expected behavior:

no tail: https://i.imgur.com/dXqFCBZ.gif

About expected behavior

I can get expected behavior on Firefox when I enable Windows Ink. Though enabling it make it uncomfortable to use a browser with my tablet.
Also note Chrome works as expected regardless win ink disabled or enabled.

More gifs: https://imgur.com/a/liGoBby

Details:
Wacom CTL-470 with its latest drivers
Win 8.1 x64
Firefox 110.0

Though enabling it make it uncomfortable to use a browser with my tablet.

Could you elaborate on this? 👀 Perhaps we can fix that one more easily.

(In reply to Kagami [:saschanaz] from comment #19)

Perhaps we can fix that one more easily.

I am not sure.

Introductory info:

  • disabling ink mode is used not only for Firefox
  • disabling ink mode is the only way to get rid of ripple animation (it plays at cursor pos when pen touches the tablet, very annoying), starting with some update of win10 it is finally became possible to disable that animation only (I won't upgrade my OS because of that)
  • I set up first pen's button to do scroll/pan (hold the button, touch the tablet with pen, move the pen up or down)
  • with ink disabled I can use the pen to select text(like you do with a mouse) and use the pen's button to scroll

The problem:

When ink is enabled it is impossible to select any text with the pen, I can only scroll. Since Chrome behaves exactly the same way, I assume it is os-related thing and you cannot fix it on the Firefox side.

When ink is enabled it is impossible to select any text with the pen, I can only scroll. Since Chrome behaves exactly the same way, I assume it is os-related thing and you cannot fix it on the Firefox side.

That's bug 1755435, setting dom.w3c_touch_events.enabled to 1 in about:config can workaround the issue. The selection behavior becomes more like a touchscreen than a mouse, though.

But yes, we should still investigate the behavior with the ink disabled.

When the issue is present, I think the pointerId increments by 1 every frame.

You need to log in before you can comment on or make changes to this bug.