#include "e_view_client_intern.h"
#include "e_policy_softkey_intern.h"
#include "e_policy_stack_intern.h"
+#include "e_compositor_intern.h"
#include <device/display.h>
#include <wayland-server.h>
}
static void
-_tzpol_iface_cb_subsurface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface, uint32_t parent_id)
+_tzpol_iface_cb_subsurface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource, uint32_t parent_id)
{
- E_Client *ec, *epc;
- Eina_Bool res;
+ E_Surface *surface = e_surface_from_resource(surface_resource);
+ E_Surface *parent_surface;
+ E_Client *epc;
- ELOGF("TZPOL",
- "SUBSURF |wl_surface@%d|parent_id:%d",
- NULL, wl_resource_get_id(surface), parent_id);
-
- ec = e_client_from_surface_resource(surface);
+ ELOGF("TZPOL","Create Subsurface: surface(%p) parent id(%d)",
+ e_surface_ec_get(surface), surface, parent_id);
epc = e_pixmap_find_client_by_res_id(parent_id);
if ((!epc) ||
(e_object_is_del(E_OBJECT(epc))))
{
ELOGF("TZPOL", "SUBSURF | Invalid parent(%p). "
- "Create with fake implementation", ec, epc);
+ "Create with fake implementation", e_surface_ec_get(surface), epc);
- e_subsurface_watcher_invalid_parent_notify(surface);
+ e_subsurface_watcher_invalid_parent_notify(surface_resource);
/* 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.
/* This check code is for detecting an error case which tries to create
* sub-surface relationship with invalid parent. */
- if ((!epc->comp_data) ||
- (!epc->comp_data->wl_surface))
+ parent_surface = e_surface_try_from_ec(epc);
+ if (!parent_surface)
{
ELOGF("TZPOL", "Parent(%p internal? %s) doesn't have comp_data. "
"Possibly it's not the surface created by client. "
"Cannot be the parent of sub-surface.",
- ec, epc, epc->internal ? "TRUE" : "FALSE");
+ e_surface_ec_get(surface), epc, epc->internal ? "TRUE" : "FALSE");
wl_resource_post_error(resource,
WL_SUBSURFACE_ERROR_BAD_SURFACE,
"Invalid parent_id@%d. Possibly it's not the "
return;
}
- res = e_comp_wl_subsurface_add(resource, id, surface,
- epc->comp_data->wl_surface);
- if (!res)
- {
- ERR("Failed to add subsurface for surface@%d", wl_resource_get_id(surface));
- return;
- }
+
+ if (!e_subsurface_create(resource, id, surface, parent_surface))
+ ERR("Failed to add subsurface for surface(%p)", surface);
}
static E_Alpha_Opaque