From 4f95825fec147677b4e79c2604d8d897ba077281 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Wed, 4 Mar 2020 09:35:30 -0500 Subject: [PATCH] evas: Fix mouse event info for legacy events. Summary: Legacy event info have canvas and output coordinates. Output coordinates have information of original position. Canvas coordinates have information of transformed position. So keep backward compatibility, fix filling legacy information. This reverts commit 7f724f6c5db1127a6dd5786791f495b58910e9a9 Reviewers: Hermet, zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11445 --- src/lib/evas/canvas/evas_events_legacy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/evas_events_legacy.c b/src/lib/evas/canvas/evas_events_legacy.c index 97b6f79..44be498 100644 --- a/src/lib/evas/canvas/evas_events_legacy.c +++ b/src/lib/evas/canvas/evas_events_legacy.c @@ -34,15 +34,18 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal { Efl_Input_Pointer_Data *ev = efl_data_scope_get(eo_ev, EFL_INPUT_POINTER_CLASS); Evas_Public_Data *evas; + Evas_Pointer_Data *pdata; if (!ev) return NULL; if (!eo_evas) eo_evas = efl_provider_find(eo_ev, EVAS_CANVAS_CLASS); evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS); if (!evas) return NULL; + pdata = _evas_pointer_data_by_device_get(evas, ev->device); + EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL); -#define COORD_DUP(e) do { (e)->output.x = (e)->canvas.x; (e)->output.y = (e)->canvas.y; } while (0) -#define COORD_DUP_CUR(e) do { (e)->cur.output.x = (e)->cur.canvas.x; (e)->cur.output.y = (e)->cur.canvas.y; } while (0) -#define COORD_DUP_PREV(e) do { (e)->prev.output.x = (e)->prev.canvas.x; (e)->prev.output.y = (e)->prev.canvas.y; } while (0) +#define COORD_DUP(e) do { (e)->output.x = pdata->seat->x; (e)->output.y = pdata->seat->y; } while (0) +#define COORD_DUP_CUR(e) do { (e)->cur.output.x = pdata->seat->x; (e)->cur.output.y = pdata->seat->y; } while (0) +#define COORD_DUP_PREV(e) do { (e)->prev.output.x = pdata->seat->prev.x; (e)->prev.output.y = pdata->seat->prev.y; } while (0) #define TYPE_CHK(typ) do { if ((type != EVAS_CALLBACK_LAST) && (type != EVAS_CALLBACK_ ## typ)) return NULL; } while (0) switch (ev->action) -- 2.7.4