Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
796 stars 100 forks source link

[VisionGlass] Add scroll gesture to the phone touchpad #1361

Closed svillar closed 5 months ago

svillar commented 5 months ago

From now on users can scroll web pages by scrolling on the touchpad of the phone UI. This involved a set of changes:

  1. Migrate from onTouchEvent() to GestureManager.onTouchEvent(). Instead of handling the low level UP/DOWN events the code will deal with onScroll, onSingleTap events recognized by the GestureManager. Due to this change scrolling via tap and tilt the controller (phone) is no longer possible.
  2. Convert PlatformActivityPlugin into an abstract class. This was done to allow some method implementations. We added a new interface implemented by VRBrowserActivity to get scroll notifications from the platform plugins.
  3. Use the current event generation machinery to deliver a scroll event to the Web widget. Note that WindowWidget was modified to prevent scroll events to reach the widget if it isn't hovered.
svillar commented 5 months ago

Great idea!

I was expecting the scroll to work in the opposite direction, like it would if the website was being shown directly on the phone. I tried flipping the vertical distance and it felt a lot more natural.

Actually there is a preference for scroll direction in Wolvic. Perhaps we want to change it, or as you mention simply invert the axis

svillar commented 5 months ago

Hmm I've found a couple of regressions:

  1. scrolling does not work in dialogs, and as we've disabled scrolling via tap and tilt, that means that some options in the settings are not visible
  2. there are actions that depend on tap and hold, like for example the button to move windows
svillar commented 5 months ago

Hmm I've found a couple of regressions:

  1. scrolling does not work in dialogs, and as we've disabled scrolling via tap and tilt, that means that some options in the settings are not visible
  2. there are actions that depend on tap and hold, like for example the button to move windows

The new version of the patch addresses these two issues.