E_API void
e_comp_wl_map_apply(E_Client *ec)
{
- E_Client *parent;
E_Comp_Wl_Buffer_Viewport *vp;
E_Comp_Wl_Subsurf_Data *sdata;
E_Comp_Wl_Client_Data *cdata;
if (e_comp_wl_subsurface_check(ec))
{
- e_comp_wl_subsurface_position_get(ec, &dx, &dy);
- parent = e_comp_wl_subsurface_parent_get(ec);
- if (parent)
- {
- dx += parent->x;
- dy += parent->y;
- }
+ e_comp_wl_subsurface_global_coord_get(ec, &dx, &dy);
sdata = ec->comp_data->sub.data;
if (sdata->remote_surface.offscreen_parent)
E_Client *ec;
E_Client *subc;
Eina_List *l;
- int x, y, sx = 0, sy = 0;
+ int x = 0 , y = 0;
if (!(ec = data)) return;
if (e_object_is_del(E_OBJECT(ec))) return;
EINA_LIST_FOREACH(ec->comp_data->sub.list, l, subc)
{
if (!e_comp_wl_subsurface_check(subc)) continue;
- e_comp_wl_subsurface_position_get(subc, &sx, &sy);
- x = ec->x + sx;
- y = ec->y + sy;
+ e_comp_wl_subsurface_global_coord_get(subc, &x, &y);
evas_object_move(subc->frame, x, y);
if (subc->comp_data->scaler.viewport)
EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
{
if (!e_comp_wl_subsurface_check(subc)) continue;
- e_comp_wl_subsurface_position_get(subc, &sx, &sy);
- x = ec->x + sx;
- y = ec->y + sy;
+ e_comp_wl_subsurface_global_coord_get(subc, &x, &y);
evas_object_move(subc->frame, x, y);
if (subc->comp_data->scaler.viewport)
static void
_e_comp_wl_surface_output_viewport_get(E_Client *ec, Eina_Rectangle *out)
{
- E_Client *parent;
- int x = 0, y = 0;
-
if (!out)
return;
return;
if (e_comp_wl_subsurface_check(ec))
- {
- e_comp_wl_subsurface_position_get(ec, &x, &y);
- parent = e_comp_wl_subsurface_parent_get(ec);
- if (parent)
- {
- out->x = parent->x + x;
- out->y = parent->y + y;
- }
- else
- {
- out->x = x;
- out->y = y;
- }
- }
+ e_comp_wl_subsurface_global_coord_get(ec, &out->x, &out->y);
else
{
out->x = ec->x;
return EINA_TRUE;
}
+EINTERN Eina_Bool
+e_comp_wl_subsurface_global_coord_get(E_Client *ec, int *x, int *y)
+{
+ E_Comp_Wl_Subsurf_Data *sdata;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(e_comp_wl_subsurface_check(ec), EINA_FALSE);
+
+ sdata = ec->comp_data->sub.data;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(sdata, EINA_FALSE);
+
+ if (x)
+ *x = sdata->position.x + (sdata->parent ? sdata->parent->x : 0);
+ if (y)
+ *y = sdata->position.y + (sdata->parent ? sdata->parent->y : 0);
+
+ return EINA_TRUE;
+}
+
static void
_e_comp_wl_subsurface_cb_dummy_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
static void
_e_video_hwc_geometry_output_rect_get(E_Client *ec, Eina_Rectangle *out)
{
- E_Client *parent;
- int sx = 0, sy = 0;
-
if (e_comp_wl_subsurface_check(ec))
- {
- e_comp_wl_subsurface_position_get(ec, &sx, &sy);
- parent = e_comp_wl_subsurface_parent_get(ec);
- if (parent)
- {
- out->x = parent->x + sx;
- out->y = parent->y + sy;
- }
- else
- {
- out->x = sx;
- out->y = sy;
- }
- }
+ e_comp_wl_subsurface_global_coord_get(ec, &out->x, &out->y);
else
{
out->x = ec->x;