Set an error value to the event info 96/140796/3 accepted/tizen/3.0/common/20170728.153437 accepted/tizen/3.0/ivi/20170728.005006 accepted/tizen/3.0/mobile/20170728.004932 accepted/tizen/3.0/tv/20170728.004944 accepted/tizen/3.0/wearable/20170728.004956 submit/tizen_3.0/20170727.001251
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 26 Jul 2017 11:25:15 +0000 (20:25 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 26 Jul 2017 11:25:15 +0000 (20:25 +0900)
On error, the viewer application wants to get an error value by using
the event info when getting the evas event about the widget instance.

Change-Id: I6e838e5bf62b3a78ec3a88a0ba3242f1f8fb32d0
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
widget_viewer_evas/src/widget_viewer_evas.c

index 376b398..3638ba4 100644 (file)
@@ -613,9 +613,12 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i
                return -1;
        }
 
-       if (info->state == WIDGET_STATE_DETACHED) {
-               __push_event_queue(info, event);
-               return 0;
+       if (event != WIDGET_INSTANCE_EVENT_FAULT &&
+                       event != WIDGET_INSTANCE_EVENT_CREATE_ABORTED) {
+               if (info->state == WIDGET_STATE_DETACHED) {
+                       __push_event_queue(info, event);
+                       return 0;
+               }
        }
 
        DbgPrint("update: %s (%d)", instance_id, event);
@@ -666,6 +669,7 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i
                widget_instance_unref(handle);
                break;
        case WIDGET_INSTANCE_EVENT_FAULT:
+               event_info.error = WIDGET_ERROR_FAULT;
                event_info.event = WIDGET_FAULT_DEACTIVATED;
                smart_signal = WIDGET_SMART_SIGNAL_WIDGET_FAULTED;
                info->pid = -1;
@@ -674,8 +678,10 @@ static int __instance_event_cb(const char *widget_id, const char *instance_id, i
                __display_overlay_text(info);
                break;
        case WIDGET_INSTANCE_EVENT_CREATE_ABORTED:
+               event_info.error = WIDGET_ERROR_CANCELED;
                event_info.event = WIDGET_EVENT_CREATED;
                smart_signal = WIDGET_SMART_SIGNAL_WIDGET_CREATE_ABORTED;
+               info->pid = -1;
                info->is_faulted = true;
                __display_overlay_text(info);
                break;