From afdcf0b2ce3ae2593bc1a447b6e598879387c431 Mon Sep 17 00:00:00 2001 From: Hyunho Kang Date: Thu, 20 Jul 2017 15:53:27 +0900 Subject: [PATCH] Send move event before mouse up event For consistency with old version of widget framework Change-Id: Ib4d3dd9282f69f580a371dc79d901a9100ffd326 Signed-off-by: Hyunho Kang --- .../src/screen_connector_toolkit_evas.c | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c index b32c04f..5349bf0 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c @@ -70,6 +70,21 @@ struct _screen_connector_toolkit_evas_h { void *data; }; +struct _move_event_info { + double x; + double y; + double rx; + double ry; + double pressure; + double angle; + double class; + double sub_class; + const char *desc; + unsigned int timestamp; +}; + +static struct _move_event_info __last_move; + static GHashTable *__cur_buffer_table = NULL; static GHashTable *__type_table = NULL; static Ecore_Event_Handler *__visibility_listener; @@ -481,6 +496,25 @@ static void __rs_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_ return; } + /* + * We need to send last move event for + * consistency with old widget framework + */ + tizen_remote_surface_transfer_mouse_event(surface, + TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_MOVE, + 0, + 0, + __last_move.x, + __last_move.y, + __last_move.rx, + __last_move.ry, + __last_move.pressure, + __last_move.angle, + __last_move.class, + __last_move.sub_class, + __last_move.desc, + __last_move.timestamp); + tizen_remote_surface_transfer_mouse_event(surface, TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP, 0, @@ -510,6 +544,17 @@ static void __rs_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *even evas_object_geometry_get(obj, &x, &y, &w, &h); + __last_move.x = ev->cur.canvas.x - x; + __last_move.y = ev->cur.canvas.y - y; + __last_move.rx = wl_fixed_from_double(ev->radius_x); + __last_move.ry = wl_fixed_from_double(ev->radius_y); + __last_move.pressure = wl_fixed_from_double(ev->pressure); + __last_move.angle = wl_fixed_from_double(ev->angle); + __last_move.class = evas_device_class_get(ev->dev); + __last_move.sub_class = evas_device_subclass_get(ev->dev); + __last_move.desc = desc; + __last_move.timestamp = ev->timestamp; + LOGD("mouse move: %d %d", ev->cur.canvas.x - x, ev->cur.canvas.y - y); if (desc == NULL) -- 2.7.4