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

LibWeb: implement navigator.maxTouchPoints #1536

Closed

Conversation

ChaseKnowlden
Copy link
Contributor

This is needed by vercel.com to determine how many touch points there is.

For #1298

@ChaseKnowlden ChaseKnowlden marked this pull request as ready for review September 26, 2024 01:12
Comment on lines 105 to 119
#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
Copy link
Member

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.

Copy link
Contributor

@paaspaas00 paaspaas00 left a 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?

@ADKaster
Copy link
Member

ADKaster commented Oct 1, 2024

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.

@ChaseKnowlden
Copy link
Contributor Author

Mac computers don't even have touch screens.

@AtkinsSJ
Copy link
Member

AtkinsSJ commented Oct 3, 2024

Mac computers don't even have touch screens.

If you plug in a graphics tablet or other touchscreen, that should be included I think. We need to ask the OS about it.

@ChaseKnowlden
Copy link
Contributor Author

I've added the code to check touch screen or trackpad support on macOS.

@ChaseKnowlden
Copy link
Contributor Author

Will cause merge conflict after #2256 is merged.

@circl-lastname
Copy link
Contributor

Apparently rebasing is enough to make it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants