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

UWP: Handle touch events #24778

Closed
wants to merge 1 commit into from
Closed

UWP: Handle touch events #24778

wants to merge 1 commit into from

Conversation

@Manishearth
Copy link
Member

Manishearth commented Nov 19, 2019

Fixes #24698

This means that we can start using the click emulation from https://github.com/servo/servo/blob/master/components/compositing/touch.rs , which is better at handling this than UWP. UWP requires a specific short tap to trigger OnTapped, and lots of folks seem to have trouble doing that.

I'm not 100% sure if this is correct since it doesn't quite disable the existing scroll handling (the ManipulationDelta stuff); I'm wondering if we should. Removing that code seems to make scrolling a bit jumpy (i also got some random zoom events?), which is counterintuitive -- if anything it should be jumpy when we have multiple scroll systems active! If the existing manipulation delta code is not removed, preventDefault() on touch events does not prevent scrolling, which isn't great.

r? @paulrouget

cc @jdm

@@ -1,3 +1,3 @@
#pragma once

#define DEFAULT_URL L"https://servo.org/hl-home/";
#define DEFAULT_URL L"https://manishearth.net/sand/inputs.html";

This comment has been minimized.

@paulrouget

paulrouget Nov 19, 2019

Contributor

Remove.

if (e.Pointer().PointerDeviceType() ==
Windows::Devices::Input::PointerDeviceType::Mouse) {
IInspectable const &, Input::PointerRoutedEventArgs const &e, bool down) {
log("pointer pressed");

This comment has been minimized.

@paulrouget

paulrouget Nov 19, 2019

Contributor

Remove. Unnecessary noise.

@paulrouget
Copy link
Contributor

paulrouget commented Nov 19, 2019

r=me with the nits addressed. This fixes part of #24598.

@paulrouget
Copy link
Contributor

paulrouget commented Nov 19, 2019

Before landing that, let me take a look at the scrolling problem you mentioned.

@Manishearth Manishearth force-pushed the Manishearth:uwp-touch branch from 208ff23 to e4e8caa Nov 19, 2019
@Manishearth
Copy link
Member Author

Manishearth commented Nov 19, 2019

Updated.

@paulrouget
Copy link
Contributor

paulrouget commented Nov 19, 2019

After testing this, I think we need to investigate a bit more what should be done here. Scrolling is badly broken.

If the main issue you want to address here is the missed click events, maybe that's something we should be reporting the MS people.

We could disable the ManipulationDelta, but we would lose the native scroll behavior. It's, in general, something I'd like to avoid across our different ports.

@paulrouget
Copy link
Contributor

paulrouget commented Dec 4, 2019

If found few issues with the touch events:

  • 2 touch down from UWP can happen, from one finger, without the intermediate touch up. Servo interpret that as another finder, triggering a pinch. We should send a touch_cancel on PointerExited as well.
  • UWP send pointer events even after sending a Lost event. Servo doesn't like that. Pinching doesn't work because of that.
  • Sometimes, Servo crashes with using 2 fingers. Not sure why yet.
  • touchmove doesn't trigger the CSS :hover state

I've investigating all these issues.

@paulrouget
Copy link
Contributor

paulrouget commented Dec 4, 2019

I think I managed to fix most of the weirdness.
Closing this PR in favor of #25076

@paulrouget paulrouget closed this Dec 4, 2019
bors-servo added a commit that referenced this pull request Dec 4, 2019
Properly send TouchEvents to Servo

This PR is based on #24778. It fixes some UWP platform weirdness (click not registering, and non-expected touch move events).
bors-servo added a commit that referenced this pull request Dec 5, 2019
Properly send TouchEvents to Servo

This PR is based on #24778. It fixes some UWP platform weirdness (click not registering, and non-expected touch move events).
bors-servo added a commit that referenced this pull request Dec 5, 2019
Properly send TouchEvents to Servo

This PR is based on #24778. It fixes some UWP platform weirdness (click not registering, and non-expected touch move events).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.