Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web] found unexpected negative PointerEvent.pointerId, but the touch event comes through #4045

Open
jameskr97 opened this issue Dec 19, 2024 · 0 comments
Labels
B - bug Dang, that shouldn't have happened DS - web

Comments

@jameskr97
Copy link

jameskr97 commented Dec 19, 2024

Description

Hello. I get the following error when using touch events on Apple mobile devices.

Here are console logs from when I was testing on iPad:
console errors

For every touch event, I get the following errors in the console. Note the intended touch event coming through WindowEvent::PointerButton -> ButtonSource::Touch does get delivered to the fn window_event function of the ApplicationHandler, though it's just spammed with these errors as well.

The line of code causing the error is here:

use crate::event::DeviceId;
pub(crate) fn mkdid(pointer_id: i32) -> Option<DeviceId> {
if let Ok(pointer_id) = u32::try_from(pointer_id) {
Some(DeviceId::from_raw(pointer_id as i64))
} else if pointer_id == -1 {
None
} else {
tracing::error!("found unexpected negative `PointerEvent.pointerId`: {pointer_id}");
None
}
}

I tried looking into the W3C spec for PointerEvent.pointerId, and it doesn't give me the impression that this number can't be negative, though I'm not too familiar.

Tested browsers

Safari (newer than listed)

Tested devices

iPhone 12 (18.1.1)
iPad Pro (18.3)

Winit version

The latest master branch, which at the time of this issue is 4d5e68c.

@jameskr97 jameskr97 added B - bug Dang, that shouldn't have happened DS - web labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - web
Development

No branches or pull requests

1 participant