summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
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 /src/lib/ecore_drm
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
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_evdev.c15
1 files changed, 14 insertions, 1 deletions
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}