#### Ecore_Drm
+have_libinput_new="no"
EFL_LIB_START_OPTIONAL([Ecore_Drm], [test "${want_drm}" = "yes"])
### Additional options to configure
EFL_DEPEND_PKG([ECORE_DRM], [DRM], [libdrm >= 2.4 xkbcommon >= 0.3.0 gbm])
EFL_DEPEND_PKG([ECORE_DRM], [LIBINPUT], [libinput >= 0.6.0])
+# API change from 0.7 to 0.8. So we define this to support both for now.
+PKG_CHECK_EXISTS([libinput >= 0.8.0],
+ [have_libinput_new="yes"],
+ [have_libinput_new="no"])
+AC_MSG_CHECKING([Use new libinput API (newer than 0.8.0)])
+AC_MSG_RESULT([${have_libinput_new}])
+if test "x${have_libinput_new}" = "xyes";then
+ AC_DEFINE_UNQUOTED([LIBINPUT_HIGHER_08], [1], [libinput version >= 0.8])
+fi
+if test "x${have_libinput_new}" = "xno";then
+ AC_DEFINE_UNQUOTED([LIBINPUT_HIGHER_08], [0], [libinput version >= 0.8])
+fi
+
+
EFL_EVAL_PKGS([ECORE_DRM])
### Checks for header files
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel)))) return;
- axis = libinput_event_pointer_get_axis(event);
timestamp = libinput_event_pointer_get_time(event);
ev->window = (Ecore_Window)input->dev->window;
ev->root.x = ev->x;
ev->root.y = ev->y;
+#ifdef 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);
+ }
+
+ 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);
+ }
+#else
+ axis = libinput_event_pointer_get_axis(event);
if (axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL) ev->direction = 1;
ev->z = libinput_event_pointer_get_axis_value(event);
+#endif
ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
}