static Eina_List *hooks = NULL;
static Eina_Bool _e_comp_wl_subsurface_circular_reference_check(E_Client *ec, E_Client *parent);
-static void _e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_client *client, uint32_t id);
+static void _e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_resource *resource);
static void
_e_comp_wl_subsurface_restack_bg_rectangle(E_Client *ec)
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return EINA_FALSE;
+ res = wl_resource_create(client, &wl_subsurface_interface, 1, id);
+ if (!res)
+ {
+ ERR("Failed to create subsurface resource");
+ wl_resource_post_no_memory(surface_resource);
+ return EINA_FALSE;
+ }
+
if (!epc || e_object_is_del(E_OBJECT(epc)))
{
ERR("tizen_policy failed: invalid parent");
- _e_comp_wl_subsurface_invalid_parent_handle(ec, client, id);
+ _e_comp_wl_subsurface_invalid_parent_handle(ec, res);
return EINA_FALSE;
}
ERR("Subsurface parent relationship is a cycle : [child win : %zx, %s], [parent win : %zx, %s]",
e_client_util_win_get(ec), e_client_util_name_get(ec),
e_client_util_win_get(epc), e_client_util_name_get(epc));
+ wl_resource_destroy(res);
return EINA_FALSE;
}
if (!(sdata = E_NEW(E_Comp_Wl_Subsurf_Data, 1)))
{
ERR("Could not allocate space for subsurface data");
- goto dat_err;
- }
-
- /* try to create the subsurface resource */
- if (!(res = wl_resource_create(client, &wl_subsurface_interface, 1, id)))
- {
- ERR("Failed to create subsurface resource");
- wl_resource_post_no_memory(surface_resource);
- goto res_err;
+ wl_resource_destroy(res);
+ return EINA_FALSE;
}
/* set resource implementation */
E_FREE_FUNC(ec->comp_data->sub.below_obj, evas_object_del);
e_comp_wl_hook_call(E_COMP_WL_HOOK_SUBSURFACE_CREATE, ec);
- return EINA_TRUE;
-res_err:
- free(sdata);
-dat_err:
- return EINA_FALSE;
+ return EINA_TRUE;
}
EINTERN void
};
static void
-_e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_client *client, uint32_t id)
+_e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_resource *resource)
{
- struct wl_resource *res;
-
if (ec->comp_data->sub.watcher)
tizen_subsurface_watcher_send_message(ec->comp_data->sub.watcher, TIZEN_SUBSURFACE_WATCHER_MSG_PARENT_ID_INVALID);
* because server will send the fatal error when a client destroy a subsurface object.
* Otherwise, server will kill a client by the fatal error.
*/
- if (!(res = wl_resource_create(client, &wl_subsurface_interface, 1, id)))
- {
- ERR("Failed to create subsurface resource");
- wl_client_post_no_memory(client);
- return;
- }
-
- wl_resource_set_implementation(res, &_e_subsurface_dummy_interface, NULL, NULL);
+ wl_resource_set_implementation(resource, &_e_subsurface_dummy_interface, NULL, NULL);
}