Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 3ae64f9

Browse files
authored
Prevent Widgets from being retained by the MotionEventGenerator after a pause. Fixes #1728 (#1811)
1 parent 8b29a0d commit 3ae64f9

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ protected void onPause() {
363363

364364
@Override
365365
protected void onResume() {
366+
MotionEventGenerator.clearDevices();
366367
mWidgetContainer.getViewTreeObserver().addOnGlobalFocusChangeListener(globalFocusListener);
367368
if (mOffscreenDisplay != null) {
368369
mOffscreenDisplay.onResume();

app/src/common/shared/org/mozilla/vrbrowser/input/MotionEventGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,8 @@ public static void dispatchScroll(Widget aWidget, int aDevice, float aX, float a
132132
device.mCoords[0].setAxisValue(MotionEvent.AXIS_VSCROLL, 0.0f);
133133
device.mCoords[0].setAxisValue(MotionEvent.AXIS_HSCROLL, 0.0f);
134134
}
135+
136+
public static void clearDevices() {
137+
devices.clear();
138+
}
135139
}

0 commit comments

Comments
 (0)