Support extra touch events 92/56392/6 accepted/tizen/mobile/20160115.111738 accepted/tizen/tv/20160115.111759 accepted/tizen/wearable/20160115.111817 submit/tizen/20160115.044121
authorJengHyun Kang <jhyuni.kang@samsung.com>
Thu, 7 Jan 2016 09:19:37 +0000 (18:19 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Fri, 15 Jan 2016 02:35:57 +0000 (18:35 -0800)
Change-Id: I80319154ddd9a160a6980cf791cd68df115d2f9d

configure.ac
src/lib/ecore_drm/ecore_drm_evdev.c [changed mode: 0644->0755]

index 2ab86a1..e248c12 100644 (file)
@@ -3233,6 +3233,11 @@ if test "x${have_libinput_new}" = "xno";then
   AC_DEFINE_UNQUOTED([LIBINPUT_HIGHER_08], [0], [libinput version >= 0.8])
 fi
 
+have_extra_touch_event="no"
+AC_CHECK_LIB(input, libinput_event_touch_get_major, [have_extra_touch_event="yes"])
+if test "x${have_extra_touch_event}" = "xyes";then
+  AC_DEFINE_UNQUOTED([LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT], [1], [libinput support extra touch event])
+fi
 
 EFL_EVAL_PKGS([ECORE_DRM])
 
old mode 100644 (file)
new mode 100755 (executable)
index e3c5f06..524aef6
@@ -715,6 +715,20 @@ _device_handle_touch_event_send(Ecore_Drm_Evdev *edev, struct libinput_event_tou
    ev->multi.radius_y = 1;
    ev->multi.pressure = 1.0;
    ev->multi.angle = 0.0;
+#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
+   if (libinput_event_get_type(libinput_event_touch_get_base_event(event))
+       == LIBINPUT_EVENT_TOUCH_DOWN)
+     {
+        if (libinput_event_touch_has_minor(event))
+          ev->multi.radius_x = libinput_event_touch_get_minor(event);
+        if (libinput_event_touch_has_major(event))
+          ev->multi.radius_y = libinput_event_touch_get_major(event);
+        if (libinput_event_touch_has_pressure(event))
+          ev->multi.pressure = libinput_event_touch_get_pressure(event);
+        if (libinput_event_touch_has_orientation(event))
+          ev->multi.angle = libinput_event_touch_get_orientation(event);
+     }
+#endif
    ev->multi.x = ev->x;
    ev->multi.y = ev->y;
    ev->multi.root.x = ev->x;
@@ -791,6 +805,16 @@ _device_handle_touch_motion_send(Ecore_Drm_Evdev *edev, struct libinput_event_to
    ev->multi.radius_y = 1;
    ev->multi.pressure = 1.0;
    ev->multi.angle = 0.0;
+#if LIBINPUT_SUPPORT_EXTRA_TOUCH_EVENT
+   if (libinput_event_touch_has_minor(event))
+     ev->multi.radius_x = libinput_event_touch_get_minor(event);
+   if (libinput_event_touch_has_major(event))
+     ev->multi.radius_y = libinput_event_touch_get_major(event);
+   if (libinput_event_touch_has_pressure(event))
+     ev->multi.pressure = libinput_event_touch_get_pressure(event);
+   if (libinput_event_touch_has_orientation(event))
+     ev->multi.angle = libinput_event_touch_get_orientation(event);
+#endif
    ev->multi.x = ev->x;
    ev->multi.y = ev->y;
    ev->multi.root.x = ev->x;