From: jeon Date: Wed, 20 Nov 2019 07:54:20 +0000 (+0900) Subject: e_input_evdev: change touch event's slot id to 0 if it is -1 X-Git-Tag: submit/tizen/20191219.081933~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F218194%2F3;p=platform%2Fupstream%2Fenlightenment.git e_input_evdev: change touch event's slot id to 0 if it is -1 - Touch event's slot id is always -1, if this device is single touch device - So change this slot id to 0 to support single touch devices Change-Id: I2149960d02ec6a5199973700b39f2b7338da8ecd --- diff --git a/src/bin/e_input_evdev.c b/src/bin/e_input_evdev.c index eb2030bb7d..bb99d94928 100644 --- a/src/bin/e_input_evdev.c +++ b/src/bin/e_input_evdev.c @@ -1125,6 +1125,21 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_ libinput_event_touch_get_y_transformed(event, h); edev->mt_slot = libinput_event_touch_get_slot(event); + if (edev->mt_slot < 0) + { + /* FIXME: The single touch device return slot id -1 + * But currently we have no API to distinguish multi touch or single touch + * After libinput 1.11 version, libinput provides get_touch_count API, + * so we can distinguish multi touch device or single touch device. + */ + if (edev->mt_slot == -1) + edev->mt_slot = 0; + else + { + WRN("%d slot touch down events are not supported\n", edev->mt_slot); + return; + } + } if (edev->mt_slot < E_INPUT_MAX_SLOTS) { @@ -1168,6 +1183,21 @@ _device_handle_touch_motion(struct libinput_device *device, struct libinput_even edev->seat->ptr.iy = edev->seat->ptr.dy; edev->mt_slot = libinput_event_touch_get_slot(event); + if (edev->mt_slot < 0) + { + /* FIXME: The single touch device return slot id -1 + * But currently we have no API to distinguish multi touch or single touch + * After libinput 1.11 version, libinput provides get_touch_count API, + * so we can distinguish multi touch device or single touch device. + */ + if (edev->mt_slot == -1) + edev->mt_slot = 0; + else + { + WRN("%d slot touch motion events are not supported\n", edev->mt_slot); + return; + } + } if (edev->mt_slot < E_INPUT_MAX_SLOTS) { @@ -1190,6 +1220,21 @@ _device_handle_touch_up(struct libinput_device *device, struct libinput_event_to } edev->mt_slot = libinput_event_touch_get_slot(event); + if (edev->mt_slot < 0) + { + /* FIXME: The single touch device return slot id -1 + * But currently we have no API to distinguish multi touch or single touch + * After libinput 1.11 version, libinput provides get_touch_count API, + * so we can distinguish multi touch device or single touch device. + */ + if (edev->mt_slot == -1) + edev->mt_slot = 0; + else + { + WRN("%d slot touch up events are not supported\n", edev->mt_slot); + return; + } + } if (edev->mt_slot < E_INPUT_MAX_SLOTS) {