Call visibility update in show,resize callback 30/107430/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170104.122245 accepted/tizen/3.0.m2/tv/20170104.122628 accepted/tizen/3.0.m2/wearable/20170104.122951 accepted/tizen/3.0/common/20161229.112720 accepted/tizen/3.0/ivi/20161229.054114 accepted/tizen/3.0/mobile/20161229.054027 accepted/tizen/3.0/tv/20161229.054047 accepted/tizen/3.0/wearable/20161229.054102 accepted/tizen/common/20170109.202237 accepted/tizen/ivi/20170105.223142 accepted/tizen/mobile/20170105.223032 accepted/tizen/tv/20170105.223102 accepted/tizen/wearable/20170105.223122 submit/tizen/20170105.005252 submit/tizen_3.0.m2/20170104.093749 submit/tizen_3.0/20161228.051438
authorSemun Lee <sm79.lee@samsung.com>
Wed, 28 Dec 2016 05:01:47 +0000 (14:01 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Wed, 28 Dec 2016 05:01:47 +0000 (14:01 +0900)
We need to update initial visibility value for the
object when it is shown or resized.
If we skip it, the display server sets its own visibility
state value for the object as invisible one.

Change-Id: I75782a77f1cabadafabf560965e34e634816d702
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
screen_connector_watcher_evas/src/screen_connector_watcher_evas.c

index e560334..9cb94d4 100644 (file)
@@ -136,7 +136,7 @@ static int __set_visibility(screen_connector_watcher_evas_h watcher_evas_h, visi
        return 0;
 }
 
-static void __obj_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void __obj_update_visibility(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        screen_connector_watcher_evas_h watcher_evas_h = (screen_connector_watcher_evas_h)data;
 
@@ -281,6 +281,7 @@ static void __rs_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *eve
 static void __rs_cb_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        LOGD("show");
+       __obj_update_visibility(data, e, obj, event_info);
 }
 
 static void __rs_cb_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -288,6 +289,12 @@ static void __rs_cb_hide(void *data, Evas *e, Evas_Object *obj, void *event_info
        LOGD("hide");
 }
 
+static void __rs_cb_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       LOGD("resize");
+       __obj_update_visibility(data, e, obj, event_info);
+}
+
 static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type, struct wl_buffer *tbm,
                int32_t img_file_fd, uint32_t img_file_size, uint32_t time, struct wl_array *keys, void *data)
 {
@@ -332,6 +339,9 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
                evas_object_event_callback_add(watcher_evas_h->img_tbm,
                                EVAS_CALLBACK_HIDE,
                                __rs_cb_hide, watcher_evas_h);
+               evas_object_event_callback_add(watcher_evas_h->img_tbm,
+                               EVAS_CALLBACK_RESIZE,
+                               __rs_cb_resize, watcher_evas_h);
 
                /* Store watcher_evas_h */
                g_hash_table_insert(__watcher_tbl, watcher_evas_h->img_tbm, watcher_evas_h);
@@ -340,7 +350,7 @@ static void __watcher_change_cb(struct tizen_remote_surface *trs, uint32_t type,
                snprintf(plug_id, sizeof(plug_id), "%s:%d", appid, pid);
                evas_object_data_set(watcher_evas_h->img_tbm, "___PLUGID", strdup(plug_id));
                evas_object_event_callback_add(watcher_evas_h->img_tbm,
-                               EVAS_CALLBACK_MOVE, __obj_move_cb, watcher_evas_h);
+                               EVAS_CALLBACK_MOVE, __obj_update_visibility, watcher_evas_h);
 
                is_added = true;
        }