derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1a339c9e5918f6d8672755d566cac622f1d9c2d3

commit 1a339c9e5918f6d8672755d566cac622f1d9c2d3
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Thu May 12 16:21:30 2016 -0500

    ecore_drm: Handle wheel scrolling separately from finger scrolling
    
    Wheels are discrete and scroll in clicks, fingers are continuous and scroll
    in fractional pixels.
    
    This change causes wheel based scrolling to be returned in "clicks"
    instead of "degrees" - allowing us to roll a single menu item with a click.
    
    It also will allow us to reduce the speed of two finger scrolling without
    messing up the speed of wheel scrolling.
---
 src/lib/ecore_drm/ecore_drm_evdev.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c 
b/src/lib/ecore_drm/ecore_drm_evdev.c
index b389e5c..4e5ad45 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -585,6 +585,22 @@ _device_handle_button(struct libinput_device *device, 
struct libinput_event_poin
      ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
 }
 
+#if LIBINPUT_HIGHER_08
+static double
+_event_scroll_get(struct libinput_event_pointer *pe, enum 
libinput_pointer_axis axis)
+{
+   switch (libinput_event_pointer_get_axis_source(pe))
+     {
+      case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL:
+         return libinput_event_pointer_get_axis_value_discrete(pe, axis);
+      case LIBINPUT_POINTER_AXIS_SOURCE_FINGER:
+      case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS:
+         return libinput_event_pointer_get_axis_value(pe, axis);
+     }
+   return 0.0;
+}
+#endif
+
 static void 
 _device_handle_axis(struct libinput_device *device, struct 
libinput_event_pointer *event)
 {
@@ -618,13 +634,13 @@ _device_handle_axis(struct libinput_device *device, 
struct libinput_event_pointe
 #if LIBINPUT_HIGHER_08
    axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
    if (libinput_event_pointer_has_axis(event, axis))
-     ev->z = libinput_event_pointer_get_axis_value(event, axis);
+     ev->z = _event_scroll_get(event, axis);
 
    axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
    if (libinput_event_pointer_has_axis(event, axis)) 
      {
         ev->direction = 1;
-        ev->z = libinput_event_pointer_get_axis_value(event, axis);
+        ev->z = _event_scroll_get(event, axis);
      }
 #else
    axis = libinput_event_pointer_get_axis(event);

-- 


Reply via email to