Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2813103003: VR: Stop mouse move events when scrolling/fling (Closed)
Patch Set: Address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 01b7e2664330c23006e069dd9ce18dad588ac577..18c8c0360eaf503b34b2872cee11fa46daa66370 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -284,6 +284,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
has_touch_handler_(false),
is_in_touchpad_gesture_scroll_(false),
is_in_touchscreen_gesture_scroll_(false),
+ is_in_touchpad_gesture_fling_(false),
latency_tracker_(),
next_browser_snapshot_id_(1),
owned_by_render_frame_host_(false),
@@ -1025,6 +1026,14 @@ void RenderWidgetHostImpl::StartNewContentRenderingTimeout(
}
void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) {
+ // VrController moves the pointer during the scrolling and fling. To ensure
+ // that scroll performance is not affected we drop mouse events during
+ // scroll/fling.
+ if (GetView()->IsInVR() &&
+ (is_in_touchpad_gesture_scroll_ || is_in_touchpad_gesture_fling_)) {
+ return;
+ }
+
ForwardMouseEventWithLatencyInfo(mouse_event,
ui::LatencyInfo(ui::SourceEventType::OTHER));
if (owner_delegate_)
@@ -1120,6 +1129,11 @@ void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo(
// gesture_event.sourceDevice ==
// blink::WebGestureDevice::WebGestureDeviceTouchpad));
*is_in_gesture_scroll = false;
+ if (gesture_event.GetType() == blink::WebInputEvent::kGestureFlingStart &&
+ gesture_event.source_device ==
+ blink::WebGestureDevice::kWebGestureDeviceTouchpad) {
+ is_in_touchpad_gesture_fling_ = true;
+ }
}
bool scroll_update_needs_wrapping =
@@ -2204,6 +2218,7 @@ void RenderWidgetHostImpl::DidOverscroll(
}
void RenderWidgetHostImpl::DidStopFlinging() {
+ is_in_touchpad_gesture_fling_ = false;
if (view_)
view_->DidStopFlinging();
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698