summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2015-02-12 18:01:55 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2015-02-12 18:06:12 +0100
commit52c48cfc214a9fb36db90748cfdf8095fd23db30 (patch)
tree23590772d9f92a41417a12156568bdbd522c96ac
parent8cbe2882276b048f096cbc9a6def4e011ba5eb46 (diff)
ecore/drm: Add support for changed libinput API since 0.8
We check for libinput 06 or higher. In version 0.8 they got an API break (hopefully the last one before 1.0) which we did not support so far. I have seen libinput 0.9 used on gentoo and newer ubuntu systems so we should definitely support them. Adding a LIBINPUT_HIGHER_08 define to check for this. So far we have only one location where we need it. Once there is a libinput 1.0 we should remove the support for older versions. http://lists.freedesktop.org/archives/wayland-devel/2015-January/019383.html
-rw-r--r--configure.ac15
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c15
2 files changed, 29 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 57c267a029..97b8828a61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3058,6 +3058,7 @@ AM_CONDITIONAL([HAVE_EEZE_TIZEN], [test "x${want_tizen}" = "xyes"])
3058 3058
3059 3059
3060#### Ecore_Drm 3060#### Ecore_Drm
3061have_libinput_new="no"
3061EFL_LIB_START_OPTIONAL([Ecore_Drm], [test "${want_drm}" = "yes"]) 3062EFL_LIB_START_OPTIONAL([Ecore_Drm], [test "${want_drm}" = "yes"])
3062 3063
3063### Additional options to configure 3064### Additional options to configure
@@ -3081,6 +3082,20 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_DRM], [eina])
3081EFL_DEPEND_PKG([ECORE_DRM], [DRM], [libdrm >= 2.4 xkbcommon >= 0.3.0 gbm]) 3082EFL_DEPEND_PKG([ECORE_DRM], [DRM], [libdrm >= 2.4 xkbcommon >= 0.3.0 gbm])
3082EFL_DEPEND_PKG([ECORE_DRM], [LIBINPUT], [libinput >= 0.6.0]) 3083EFL_DEPEND_PKG([ECORE_DRM], [LIBINPUT], [libinput >= 0.6.0])
3083 3084
3085# API change from 0.7 to 0.8. So we define this to support both for now.
3086PKG_CHECK_EXISTS([libinput >= 0.8.0],
3087 [have_libinput_new="yes"],
3088 [have_libinput_new="no"])
3089AC_MSG_CHECKING([Use new libinput API (newer than 0.8.0)])
3090AC_MSG_RESULT([${have_libinput_new}])
3091if test "x${have_libinput_new}" = "xyes";then
3092 AC_DEFINE_UNQUOTED([LIBINPUT_HIGHER_08], [1], [libinput version >= 0.8])
3093fi
3094if test "x${have_libinput_new}" = "xno";then
3095 AC_DEFINE_UNQUOTED([LIBINPUT_HIGHER_08], [0], [libinput version >= 0.8])
3096fi
3097
3098
3084EFL_EVAL_PKGS([ECORE_DRM]) 3099EFL_EVAL_PKGS([ECORE_DRM])
3085 3100
3086### Checks for header files 3101### Checks for header files
diff --git a/src/lib/ecore_drm/ecore_drm_evdev.c b/src/lib/ecore_drm/ecore_drm_evdev.c
index 8d6bbedce4..42b61f4b40 100644
--- a/src/lib/ecore_drm/ecore_drm_evdev.c
+++ b/src/lib/ecore_drm/ecore_drm_evdev.c
@@ -503,7 +503,6 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
503 503
504 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel)))) return; 504 if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel)))) return;
505 505
506 axis = libinput_event_pointer_get_axis(event);
507 timestamp = libinput_event_pointer_get_time(event); 506 timestamp = libinput_event_pointer_get_time(event);
508 507
509 ev->window = (Ecore_Window)input->dev->window; 508 ev->window = (Ecore_Window)input->dev->window;
@@ -522,8 +521,22 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
522 ev->root.x = ev->x; 521 ev->root.x = ev->x;
523 ev->root.y = ev->y; 522 ev->root.y = ev->y;
524 523
524#ifdef LIBINPUT_HIGHER_08
525 axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
526 if (libinput_event_pointer_has_axis(event, axis)) {
527 ev->z = libinput_event_pointer_get_axis_value(event, axis);
528 }
529
530 axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL;
531 if (libinput_event_pointer_has_axis(event, axis)) {
532 ev->direction = 1;
533 ev->z = libinput_event_pointer_get_axis_value(event, axis);
534 }
535#else
536 axis = libinput_event_pointer_get_axis(event);
525 if (axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL) ev->direction = 1; 537 if (axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL) ev->direction = 1;
526 ev->z = libinput_event_pointer_get_axis_value(event); 538 ev->z = libinput_event_pointer_get_axis_value(event);
539#endif
527 540
528 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL); 541 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
529} 542}