-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
LibWeb: implement navigator.maxTouchPoints #1536
LibWeb: implement navigator.maxTouchPoints #1536
Conversation
#if defined(AK_OS_MACOS) | ||
int max_touch_points = 1; | ||
return max_touch_points; | ||
#elif defined(AK_OS_LINUX) | ||
int max_touch_points = 20; | ||
return max_touch_points; | ||
#else | ||
return 0; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it's sufficient to return an arbitrary number based on the platform like this. The number returned should depend on the underlying hardware of the given machine. For example, Chrome returns 10 on my touchscreen laptop, but 0 on my desktop. If we can't figure out what is supported by the hardware then I think the best thing to do is to return 0, which implies that touch input is not supported.
e275b56
to
123866e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is linux-only, would you mind adding an implementation for Mac and possibly Windows too?
There's no sense in adding a Windows implementation, as we can't build the application for windows. |
0557fd9
to
6ad0e77
Compare
Mac computers don't even have touch screens. |
6ad0e77
to
bf44727
Compare
bf44727
to
ba506e2
Compare
If you plug in a graphics tablet or other touchscreen, that should be included I think. We need to ask the OS about it. |
I've added the code to check touch screen or trackpad support on macOS. |
Will cause merge conflict after #2256 is merged. |
Apparently rebasing is enough to make it work |
This is needed by vercel.com to determine how many touch points there is.
For #1298