summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-27 14:09:28 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-28 17:40:17 +0100
commit6f8fd6932b5b0d26933134d5c90ba35bbe9dbd1c (patch)
treedf267b33cc35f3cb203dbb78b117d99dde859e19
parent6fd05023424fd292bdce98bb22b0de04c81a3682 (diff)
downloadefl-devs/bu5hm4n/work_multi_input.tar.gz
ecore/input: attempt to more accurately handle multi-touch mouse-in eventsdevs/bu5hm4n/work_multi_input
when dealing with touch events, we should attempt to rely more on the hw event stream rather than synthesizing our own events with incorrect data. mouse in/out events don't usually provide device data, so we have no need to emit these events in the case of multi-touch event sequences Differential Revision: https://phab.enlightenment.org/D11205
-rw-r--r--src/lib/ecore_input_evas/ecore_input_evas.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c
index bd2f0d1868..3c99dc48ed 100644
--- a/src/lib/ecore_input_evas/ecore_input_evas.c
+++ b/src/lib/ecore_input_evas/ecore_input_evas.c
@@ -133,7 +133,10 @@ _ecore_event_evas_lookup(Evas_Device *evas_device, unsigned int device,
//the number of last event is small, simple check is ok.
EINA_LIST_FOREACH(_last_events, l, eel)
if ((eel->device == device) && (eel->buttons == buttons) && (eel->evas_device == evas_device))
- return eel;
+ {
+ _last_events = eina_list_promote_list(_last_events, l);
+ return eel;
+ }
if (!create_new) return NULL;
eel = malloc(sizeof (Ecore_Event_Last));
if (!eel) return NULL;
@@ -147,7 +150,7 @@ _ecore_event_evas_lookup(Evas_Device *evas_device, unsigned int device,
eel->win = win;
eel->evas_device = evas_device;
- _last_events = eina_list_append(_last_events, eel);
+ _last_events = eina_list_prepend(_last_events, eel);
return eel;
}
@@ -670,6 +673,8 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
{
Ecore_Input_Window *lookup;
Eo *seat;
+ Eina_List *l;
+ Ecore_Event_Last *eel;
lookup = _ecore_event_window_match(e->event_window);
if (!lookup) return ECORE_CALLBACK_PASS_ON;
@@ -696,6 +701,15 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
break;
}
+ /* check whether we have a multi-touch press event here */
+ EINA_LIST_FOREACH(_last_events, l, eel)
+ {
+ if ((eel->state == ECORE_INPUT_DOWN) && eel->device)
+ return ECORE_CALLBACK_PASS_ON;
+ if (eel->state != ECORE_INPUT_DOWN) break;
+ }
+ /* a multi-touch event sequence will emit move events normally along with
+ * accurate device info, so we have no need to do anything here */
lookup->move_mouse(lookup->window, e->x, e->y, e->timestamp);
return ECORE_CALLBACK_PASS_ON;
}