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

Add a gesture to open up a context menu; fix quitting #144

Merged
merged 3 commits into from
Mar 30, 2020

Conversation

Manishearth
Copy link
Member

@Manishearth Manishearth commented Mar 27, 2020

This adds a gesture (currently: "palm facing upwards") to open up a context menu.

servo side: servo/servo#26051

r? @jdm

@Manishearth
Copy link
Member Author

A better version of this gesture would include head pose. I think the original suggested gesture was "looking at the palm of your hand", perhaps with the hand pointing upwards.

InputFrame,
/* clicked */ Option<SelectEvent>,
/* squeezed */ Option<SelectEvent>,
/* menu_selected */ bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning a real structure with named fields might be useful at this point.

let mut menu_selected = false;
// Check if the palm is facing up. This is our "menu" gesture.
if let Some(grip_origin) = grip_origin {
// The X axis of the grip is perpendicular to the palm, however it's
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: its

-1.0
};

// Rotate it by the grip to btain the desired vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: obtain

// close to 1
if angle > 0.9 {
self.menu_gesture_sustain += 1;
if self.menu_gesture_sustain > 60 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this a named constant?

@@ -65,19 +65,58 @@ pub trait SurfaceProviderRegistration: Send {
fn clone(&self) -> Box<dyn SurfaceProviderRegistration>;
}

///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Provides a way to interact with context menus.

@Manishearth
Copy link
Member Author

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

📌 Commit 20408f2 has been approved by jdm

bors-servo added a commit that referenced this pull request Mar 30, 2020
Add a gesture to open up a context menu; fix quitting

This adds a gesture (currently: "palm facing upwards") to open up a context menu.

servo side: servo/servo#26051

r? @jdm
@bors-servo
Copy link
Contributor

⌛ Testing commit 20408f2 with merge 17e1e0a...

@bors-servo
Copy link
Contributor

💔 Test failed - checks-travis

@Manishearth
Copy link
Member Author

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

📌 Commit 1557ec4 has been approved by jdm

@bors-servo
Copy link
Contributor

⌛ Testing commit 1557ec4 with merge ee1236e...

bors-servo added a commit that referenced this pull request Mar 30, 2020
Add a gesture to open up a context menu; fix quitting

This adds a gesture (currently: "palm facing upwards") to open up a context menu.

servo side: servo/servo#26051

r? @jdm
@Manishearth
Copy link
Member Author

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

📌 Commit 8a53399 has been approved by jdm

@bors-servo
Copy link
Contributor

⌛ Testing commit 8a53399 with merge 54cb883...

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-travis
Approved by: jdm
Pushing 54cb883 to master...

@bors-servo bors-servo merged commit 54cb883 into servo:master Mar 30, 2020
@Manishearth Manishearth deleted the menu-gesture branch March 30, 2020 22:05
bors-servo added a commit to servo/servo that referenced this pull request Mar 30, 2020
Hook up new openxr context menu gesture to embedder context menu machinery

Based on #26043

Fixes #25797, #26057

servo/webxr#144 needs to land first

Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it.

r? @jdm

cc @paulrouget
bors-servo added a commit to servo/servo that referenced this pull request Mar 31, 2020
Hook up new openxr context menu gesture to embedder context menu machinery

Based on #26043

Fixes #25797, #26057

servo/webxr#144 needs to land first

Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it.

r? @jdm

cc @paulrouget
bors-servo added a commit to servo/servo that referenced this pull request Mar 31, 2020
Hook up new openxr context menu gesture to embedder context menu machinery

Based on #26043

Fixes #25797, #26057

servo/webxr#144 needs to land first

Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it.

r? @jdm

cc @paulrouget
bors-servo added a commit to servo/servo that referenced this pull request Mar 31, 2020
Hook up new openxr context menu gesture to embedder context menu machinery

Based on #26043

Fixes #25797, #26057

servo/webxr#144 needs to land first

Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it.

r? @jdm

cc @paulrouget
bors-servo added a commit to servo/servo that referenced this pull request Mar 31, 2020
Hook up new openxr context menu gesture to embedder context menu machinery

Based on #26043

Fixes #25797, #26057

servo/webxr#144 needs to land first

Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it.

r? @jdm

cc @paulrouget
bors-servo added a commit to servo/servo that referenced this pull request Apr 1, 2020
Hook up new openxr context menu gesture to embedder context menu machinery

Based on #26043

Fixes #25797, #26057

servo/webxr#144 needs to land first

Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it.

r? @jdm

cc @paulrouget
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.

3 participants