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

Unified Diff: content/renderer/webscrollbarbehavior_impl_gtkoraura.cc

Issue 393723002: Eliminate drag-off-end scroll canceling for Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
diff --git a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc b/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
index e9d77bb3f50c81192d3d75e843ca5525c3c4fbb5..b866e29138fc2cc096147b072b3ea896516d19f3 100644
--- a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
+++ b/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
@@ -40,8 +40,16 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin(
(isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness,
(isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness);
- // We should snap iff the event is outside our calculated rect.
+ // On most platforms, we should snap iff the event is outside our calculated
+ // rect. On Linux, however, we should not snap for events off the ends, but
+ // not the sides, of the rect.
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ return isHorizontal ?
+ (eventPoint.y < noSnapRect.y() || eventPoint.y >= noSnapRect.bottom()) :
+ (eventPoint.x < noSnapRect.x() || eventPoint.x >= noSnapRect.right());
+#else
return !noSnapRect.Contains(eventPoint);
+#endif
}
} // namespace content
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698