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_restack_bg_rectangle(E_Client *ec)
DBG("Subsurface Cb Position Set: %d", wl_resource_get_id(resource));
- /* try to get the client from resource data */
- if (!(ec = wl_resource_get_user_data(resource))) return;
+ ec = wl_resource_get_user_data(resource);
+
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
if (!(sdata = ec->comp_data->sub.data)) return;
DBG("Subsurface Cb Place Above: %d", wl_resource_get_id(resource));
- /* try to get the client from resource data */
- if (!(ec = wl_resource_get_user_data(resource))) return;
+ ec = wl_resource_get_user_data(resource);
+
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
if (!ec->comp_data->sub.data) return;
DBG("Subsurface Cb Place Below: %d", wl_resource_get_id(resource));
- /* try to get the client from resource data */
- if (!(ec = wl_resource_get_user_data(resource))) return;
+ ec = wl_resource_get_user_data(resource);
+
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
if (!ec->comp_data->sub.data) return;
DBG("Subsurface Cb Sync Set: %d", wl_resource_get_id(resource));
- /* try to get the client from resource data */
- if (!(ec = wl_resource_get_user_data(resource))) return;
+ ec = wl_resource_get_user_data(resource);
+
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
if (!(sdata = ec->comp_data->sub.data)) return;
DBG("Subsurface Cb Desync Set: %d", wl_resource_get_id(resource));
- /* try to get the client from resource data */
- if (!(ec = wl_resource_get_user_data(resource))) return;
+ ec = wl_resource_get_user_data(resource);
+
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
if (!(sdata = ec->comp_data->sub.data)) return;
if (!epc || e_object_is_del(E_OBJECT(epc)))
{
- if (ec->comp_data->sub.watcher)
- tizen_subsurface_watcher_send_message(ec->comp_data->sub.watcher, TIZEN_SUBSURFACE_WATCHER_MSG_PARENT_ID_INVALID);
-
- /* We have to create a subsurface resource here even though it's error case
- * 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_resource_post_no_memory(surface_resource);
- return EINA_FALSE;
- }
-
- wl_resource_set_implementation(res, &_e_subsurface_interface, NULL, NULL);
-
ERR("tizen_policy failed: invalid parent");
+ _e_comp_wl_subsurface_invalid_parent_handle(ec, client, id);
return EINA_FALSE;
}
_e_comp_wl_subsurface_check_below_bg_rectangle(ec);
}
+
+static void
+_e_comp_wl_subsurface_cb_dummy_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+{
+ wl_resource_destroy(resource);
+}
+
+static void
+_e_comp_wl_subsurface_cb_dummy_position_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED)
+{
+}
+
+static void
+_e_comp_wl_subsurface_cb_dummy_place_above(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, struct wl_resource *sibling_resource EINA_UNUSED)
+{
+}
+
+static void
+_e_comp_wl_subsurface_cb_dummy_place_below(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, struct wl_resource *sibling_resource EINA_UNUSED)
+{
+}
+
+static void
+_e_comp_wl_subsurface_cb_dummy_sync_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED)
+{
+}
+
+static void
+_e_comp_wl_subsurface_cb_dummy_desync_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED)
+{
+}
+
+static const struct wl_subsurface_interface _e_subsurface_dummy_interface =
+{
+ _e_comp_wl_subsurface_cb_dummy_destroy,
+ _e_comp_wl_subsurface_cb_dummy_position_set,
+ _e_comp_wl_subsurface_cb_dummy_place_above,
+ _e_comp_wl_subsurface_cb_dummy_place_below,
+ _e_comp_wl_subsurface_cb_dummy_sync_set,
+ _e_comp_wl_subsurface_cb_dummy_desync_set,
+};
+
+static void
+_e_comp_wl_subsurface_invalid_parent_handle(E_Client *ec, struct wl_client *client, uint32_t id)
+{
+ 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);
+
+ /* We have to create a subsurface resource here even though it's error case
+ * 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);
+}