Auto merge of #24013 - paulrouget:gestureCapture, r=jdm

[hololens] Gesture capture

I can't reproduce #24010 but I think this should fix it.

Fix #24010

Depends on #24008

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24013)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-08-23 01:06:45 -04:00 committed by GitHub
commit 5bf00c07c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 19 deletions

View file

@ -32,9 +32,22 @@ void ServoControl::Shutdown() {
}
void ServoControl::OnLoaded(IInspectable const &, RoutedEventArgs const &) {
Panel().PointerReleased(
auto panel = Panel();
panel.PointerReleased(
std::bind(&ServoControl::OnSurfaceClicked, this, _1, _2));
Panel().ManipulationDelta(
panel.ManipulationStarted(
[=](IInspectable const &,
Input::ManipulationStartedRoutedEventArgs const &e) {
mOnCaptureGesturesStartedEvent();
e.Handled(true);
});
panel.ManipulationCompleted(
[=](IInspectable const &,
Input::ManipulationCompletedRoutedEventArgs const &e) {
mOnCaptureGesturesEndedEvent();
e.Handled(true);
});
panel.ManipulationDelta(
std::bind(&ServoControl::OnSurfaceManipulationDelta, this, _1, _2));
InitializeConditionVariable(&mGLCondVar);
InitializeCriticalSection(&mGLLock);