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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2256733003: Touchpad scroll latching enabled for Mac behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e2dbba06fd19fba4d4c501073bd104f508eddba0..13fe718fefb17095f3b91a3efb59020210a6d779 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2687,6 +2687,11 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
MainThreadScrollingReason::kNotScrollingOnMain;
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin");
+ // On Mac a scroll begin with |inertial_phase| = true happens to handle a
+ // fling.
+ if (scroll_state->is_in_inertial_phase())
+ return FlingScrollBegin();
+
ClearCurrentlyScrollingLayer();
gfx::Point viewport_point(scroll_state->position_x(),
@@ -3234,7 +3239,12 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) {
DistributeScrollDelta(scroll_state);
top_controls_manager_->ScrollEnd();
- ClearCurrentlyScrollingLayer();
+
+ if (scroll_state->is_in_inertial_phase()) {
dtapuska 2016/08/18 00:30:45 I'm a bit concerned this isn't correct for devices
sahel 2016/08/18 15:41:56 It's ok if we don't do the latching for whatever r
+ // Only clear the currently scrolling layer if we know the scroll is done.
+ // A non-inertial scroll end could be followed by an inertial scroll.
+ ClearCurrentlyScrollingLayer();
+ }
}
InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {

Powered by Google App Engine
This is Rietveld 408576698