guint resuming_timer;
GList *viewer_visibility_list;
visibility_type auto_visibility;
+ int bind_win_id;
void *data;
};
return !(win->win_id == GPOINTER_TO_INT(b));
}
+static int __set_window_visibility_info(
+ screen_connector_toolkit_evas_h h,
+ int win_id, visibility_type visibility)
+{
+ viewer_visibility_h visibility_h;
+ GList *tmp_list = NULL;
+
+ if (h->viewer_visibility_list)
+ tmp_list = g_list_find_custom(
+ h->viewer_visibility_list,
+ GINT_TO_POINTER(win_id), __comp_win_id);
+
+ if (tmp_list == NULL) {
+ visibility_h = (viewer_visibility_h)calloc(1,
+ sizeof(struct _viewer_visibility_h));
+ if (visibility_h == NULL) {
+ LOGE("Out of memory fail to alloc");
+ return -1;
+ }
+ h->viewer_visibility_list =
+ g_list_append(
+ h->viewer_visibility_list,
+ visibility_h);
+ } else {
+ visibility_h = (viewer_visibility_h)tmp_list->data;
+ }
+ visibility_h->win_id = win_id;
+ visibility_h->visibility = visibility;
+
+ LOGI("set win(%d) to (%d), len(%d)", win_id, visibility, g_list_length(h->viewer_visibility_list));
+
+ return 0;
+}
+
+static int __remove_window_visibility_info(
+ screen_connector_toolkit_evas_h h,
+ int win_id)
+{
+ viewer_visibility_h visibility_h;
+ GList *tmp_list;
+
+ tmp_list = g_list_find_custom(
+ h->viewer_visibility_list,
+ GINT_TO_POINTER(win_id), __comp_win_id);
+
+ if (tmp_list == NULL) {
+ LOGE("win id %d not exist");
+ return -1;
+ }
+
+ visibility_h = (viewer_visibility_h)tmp_list->data;
+ h->viewer_visibility_list = g_list_remove(
+ h->viewer_visibility_list,
+ visibility_h);
+ free(visibility_h);
+
+ LOGI("remove win(%d) len(%d)", win_id, g_list_length(h->viewer_visibility_list));
+
+ return 0;
+}
+
static void __destroy_type_h(gpointer data)
{
screen_connector_type_evas_h type_h = (screen_connector_type_evas_h)data;
screen_connector_toolkit_evas_h toolkit_evas_h;
cur_buffer_info_h c_buf_info;
bool duplicate_buffer = false;
+ Ecore_Wl_Window *wl_win;
toolkit_evas_h = (screen_connector_toolkit_evas_h)data;
if (toolkit_evas_h->img_tbm == NULL) {
evas_object_data_set(toolkit_evas_h->img_tbm, SC_TOOLKIT_HANDLE_TAG, toolkit_evas_h);
evas_object_event_callback_add(toolkit_evas_h->img_tbm,
EVAS_CALLBACK_MOVE, __obj_update_visibility, toolkit_evas_h);
+
+ wl_win = elm_win_wl_window_get(
+ toolkit_evas_h->type_h->viewer_win);
+ if (!wl_win)
+ LOGE("failed to get wl_win");
+
+ __set_window_visibility_info(toolkit_evas_h, ecore_wl_window_id_get(wl_win),
+ VISIBILITY_TYPE_UNKNOWN);
}
if (toolkit_evas_h->img_type != type)
Ecore_Wl_Event_Window_Visibility_Change *ev = user_data;
int ret;
visibility_type type;
- GList *tmp_list = NULL;
GList *iter;
viewer_visibility_h visibility_h;
else
type = VISIBILITY_TYPE_UNOBSCURED;
- if (toolkit_evas_h->viewer_visibility_list) {
- tmp_list = g_list_find_custom(
- toolkit_evas_h->viewer_visibility_list,
- GINT_TO_POINTER(ev->win), __comp_win_id);
- }
-
- if (tmp_list == NULL) {
- visibility_h = (viewer_visibility_h)calloc(1,
- sizeof(struct _viewer_visibility_h));
- if (visibility_h == NULL) {
- LOGE("Out of memory fail to alloc");
- return;
- }
- visibility_h->win_id = ev->win;
- visibility_h->visibility = type;
- toolkit_evas_h->viewer_visibility_list =
- g_list_append(toolkit_evas_h->viewer_visibility_list,
- visibility_h);
- } else {
- visibility_h = (viewer_visibility_h)tmp_list->data;
- visibility_h->visibility = type;
- }
+ __set_window_visibility_info(toolkit_evas_h, ev->win, type);
type = VISIBILITY_TYPE_FULLY_OBSCURED;
iter = toolkit_evas_h->viewer_visibility_list;
while (iter != NULL) {
{
struct wl_surface *surface;
Ecore_Wl_Window *wl_win;
- viewer_visibility_h visibility_h;
struct tizen_remote_surface *trs;
cur_buffer_info_h c_buf_info;
+ int ret;
+ int bind_win_id;
if (!h)
return -1;
return -1;
}
- visibility_h = (viewer_visibility_h)calloc(1,
- sizeof(struct _viewer_visibility_h));
- if (visibility_h == NULL) {
- LOGE("Out of memory fail to alloc");
+ bind_win_id = ecore_wl_window_id_get(wl_win);
+ ret = __set_window_visibility_info(h, bind_win_id,
+ VISIBILITY_TYPE_UNKNOWN);
+ if (ret < 0) {
+ LOGE("failed to set visibility info");
return -1;
}
- visibility_h->win_id = ecore_wl_window_id_get(wl_win);
- visibility_h->visibility = VISIBILITY_TYPE_UNKNOWN;
+ h->bind_win_id = bind_win_id;
- h->viewer_visibility_list =
- g_list_append(h->viewer_visibility_list, visibility_h);
trs = screen_connector_toolkit_get_trs(h->toolkit_h);
if (trs)
tizen_remote_surface_transfer_touch_cancel(trs);
return -1;
}
+ __remove_window_visibility_info(h, h->bind_win_id);
+
return screen_connector_toolkit_unbind(h->toolkit_h);
}