Cancel mouse event when the widget is invisible 79/142279/2
authorJunghoon Park <jh9216.park@samsung.com>
Thu, 3 Aug 2017 08:19:09 +0000 (17:19 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Thu, 3 Aug 2017 08:35:35 +0000 (08:35 +0000)
- After wdiget is paused, the event for mouse events may be ignored
- If mouse-up event is missed, a button will not be enabled again
- To cover this issue, mouse-cancel event should be sent when the widget
  is paused

Change-Id: Ife9eec5971dab78a949ab0826f91a902740365bc
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c

index 5349bf0..453b3da 100644 (file)
@@ -59,7 +59,6 @@ struct _screen_connector_toolkit_evas_h {
        screen_connector_toolkit_h toolkit_h;
        int freeze;
        bool is_init;
-       bool cancel_touch;
        Evas_Object *img_tbm;
        Evas_Object *img_file;
        uint32_t img_type;
@@ -384,6 +383,9 @@ static int __set_visibility(screen_connector_toolkit_evas_h toolkit_evas_h, visi
                return -1;
 
        if (__delayed_resuming_time == 0) {
+               if (obscured == TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_INVISIBLE)
+                       tizen_remote_surface_transfer_touch_cancel(surface);
+
                tizen_remote_surface_transfer_visibility(surface, obscured);
 
                return 0;
@@ -394,6 +396,8 @@ static int __set_visibility(screen_connector_toolkit_evas_h toolkit_evas_h, visi
                        g_source_remove(toolkit_evas_h->resuming_timer);
                        toolkit_evas_h->resuming_timer = 0;
                }
+
+               tizen_remote_surface_transfer_touch_cancel(surface);
                tizen_remote_surface_transfer_visibility(surface, obscured);
        } else {
                if (toolkit_evas_h->resuming_timer == 0) {
@@ -1174,7 +1178,6 @@ EXPORT_API int screen_connector_toolkit_evas_send_touch_cancel(Evas_Object *obj)
                }
 
                tizen_remote_surface_transfer_touch_cancel(surface);
-               toolkit_evas_h->cancel_touch = true;
        } else {
                LOGE("surface not yet initialized.");
                return -1;