Send move event before mouse up event 94/139694/4 accepted/tizen/3.0/common/20170803.140133 accepted/tizen/3.0/ivi/20170803.010717 accepted/tizen/3.0/mobile/20170803.010704 accepted/tizen/3.0/tv/20170803.010708 accepted/tizen/3.0/wearable/20170803.010713 submit/tizen_3.0/20170731.115724
authorHyunho Kang <hhstark.kang@samsung.com>
Thu, 20 Jul 2017 06:53:27 +0000 (15:53 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 31 Jul 2017 00:40:30 +0000 (00:40 +0000)
For consistency with old version of widget framework

Change-Id: Ib4d3dd9282f69f580a371dc79d901a9100ffd326
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c

index b32c04f..5349bf0 100644 (file)
@@ -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)