Bug 1294707 - Part 1: Revert Fennec so that it treats mouse clicks as touch events. r=kats, a=ritu
authorRandall Barker <rbarker@mozilla.com>
Tue, 20 Sep 2016 13:47:00 -0400
changeset 350334 4b547741edf0439ea1ef1129615358894e79edf7
parent 350333 bc29a87b7aafe77a186051eb8d0b9453d49ce433
child 350335 0a2576dac20b06ed7a288f9dee84c99bd70ab5fc
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, ritu
bugs1294707
milestone50.0
Bug 1294707 - Part 1: Revert Fennec so that it treats mouse clicks as touch events. r=kats, a=ritu
mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
@@ -160,21 +160,27 @@ class NativePanZoomController extends JN
             mPointerScrollFactor = outValue.getDimension(view.getContext().getResources().getDisplayMetrics());
         } else {
             mPointerScrollFactor = MAX_SCROLL;
         }
     }
 
     @Override
     public boolean onTouchEvent(MotionEvent event) {
-        if (event.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) {
-            return handleMouseEvent(event);
-        } else {
-            return handleMotionEvent(event);
-        }
+// NOTE: This commented out block of code allows Fennec to generate
+//       mouse event instead of converting them to touch events.
+//       This gives Fennec similar behaviour to desktop when using
+//       a mouse.
+//
+//        if (event.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) {
+//            return handleMouseEvent(event);
+//        } else {
+//            return handleMotionEvent(event);
+//        }
+        return handleMotionEvent(event);
     }
 
     @Override
     public boolean onMotionEvent(MotionEvent event) {
         final int action = event.getActionMasked();
         if (action == MotionEvent.ACTION_SCROLL) {
             if (event.getDownTime() >= mLastDownTime) {
                 mLastDownTime = event.getDownTime();