Fix manual render auto visibility 06/143706/1 accepted/tizen/3.0/common/20170811.132433 accepted/tizen/3.0/ivi/20170811.095448 accepted/tizen/3.0/mobile/20170811.095400 accepted/tizen/3.0/tv/20170811.095428 accepted/tizen/3.0/wearable/20170811.095523 submit/tizen_3.0/20170811.051720
authorHyunho Kang <hhstark.kang@samsung.com>
Fri, 11 Aug 2017 04:59:35 +0000 (13:59 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Fri, 11 Aug 2017 05:01:29 +0000 (14:01 +0900)
Watch object added by rid have to be checked when send visibility

Change-Id: I61597c96f4a4dd58c5564c7d01ad8343fff48cff
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
watch-control/src/control.c

index 8291169..c255829 100644 (file)
@@ -64,6 +64,7 @@ static int __watch_size_policy = WATCH_POLICY_HINT_EXPAND;
 static int __default_width;
 static int __default_height;
 static screen_connector_toolkit_evas_h __toolkit;
+static screen_connector_toolkit_evas_h __rid_toolkit;
 
 static Evas_Object *__win;
 static char *__watch_appid;
@@ -84,7 +85,7 @@ struct dead_cb_s {
 
 GQueue *__pending_queue;
 static int __change_viewer_visibility(int visibility, bool update_cur_state);
-static int __change_visibility(bool visible);
+static int __change_visibility(int visibility);
 static GDBusConnection *__gdbus_conn;
 static guint __lcd_subscribe_id;
 
@@ -182,12 +183,17 @@ static void __manual_render_finish(void)
        ecore_evas_manual_render_set(ee, EINA_FALSE);
        LOGI("set manual false");
 
-       auto_visibility = screen_connector_toolkit_evas_auto_visibility(__toolkit);
-       if (auto_visibility == VISIBILITY_TYPE_PARTIALLY_OBSCURED ||
-                       auto_visibility == VISIBILITY_TYPE_UNOBSCURED)
-               __change_visibility(true);
-       else
-               __change_visibility(false);
+       if (__toolkit) {
+               auto_visibility =
+                       screen_connector_toolkit_evas_auto_visibility(__toolkit);
+               __change_visibility(auto_visibility);
+               LOGI("send visibility %d", auto_visibility);
+       } else if (__rid_toolkit) {
+               auto_visibility =
+                       screen_connector_toolkit_evas_auto_visibility(__rid_toolkit);
+               __change_visibility(auto_visibility);
+               LOGI("send visibility %d", auto_visibility);
+       }
 
        __manual_render = false;
 }
@@ -397,6 +403,7 @@ API int watch_manager_set_resource_id(int resource_id)
                _E("Fail screen_connector_toolkit_evas_add_by_rid");
                return -1;
        }
+       __rid_toolkit = handle;
 
        if (__watch_appid) {
                free(__watch_appid);
@@ -726,7 +733,7 @@ API int watch_manager_notify_paused_status_of_viewer(void)
        return __change_viewer_visibility(AUL_SCREEN_STATUS_PAUSE, true);
 }
 
-static int __change_visibility(bool visible)
+static int __change_visibility(int visibility)
 {
        Evas_Object *image;
 
@@ -736,23 +743,17 @@ static int __change_visibility(bool visible)
                return -1;
        }
 
-       if (visible) {
-               return screen_connector_toolkit_evas_send_visibility(image,
-                       VISIBILITY_TYPE_UNOBSCURED);
-       } else {
-               return screen_connector_toolkit_evas_send_visibility(image,
-                       VISIBILITY_TYPE_FULLY_OBSCURED);
-       }
+       return screen_connector_toolkit_evas_send_visibility(image, visibility);
 }
 
 API int watch_manager_pause(void)
 {
-       return __change_visibility(false);
+       return __change_visibility(VISIBILITY_TYPE_FULLY_OBSCURED);
 }
 
 API int watch_manager_resume(void)
 {
-       return __change_visibility(true);
+       return __change_visibility(VISIBILITY_TYPE_UNOBSCURED);
 }
 
 API int watch_manager_window_bind(Evas_Object *win)