}
// check parent matrix change
- if (cdata)
+ E_Client *parent = e_comp_wl_subsurface_parent_get(ec);
+ if (parent && parent->transform_core.result.enable)
{
- if (cdata->sub.data)
- {
- E_Client *parent = cdata->sub.data->parent;
-
- if (parent && parent->transform_core.result.enable)
- {
- ec->transform_core.parent.enable = EINA_TRUE;
+ ec->transform_core.parent.enable = EINA_TRUE;
- if (!e_util_transform_matrix_equal_check(&ec->transform_core.parent.matrix,
- &parent->transform_core.result.matrix))
- {
- check = EINA_TRUE;
- ec->transform_core.parent.matrix = parent->transform_core.result.matrix;
- }
- }
- else if (ec->transform_core.parent.enable)
- {
- ec->transform_core.parent.enable = EINA_FALSE;
- e_util_transform_matrix_load_identity(&ec->transform_core.parent.matrix);
- check = EINA_TRUE;
- }
+ if (!e_util_transform_matrix_equal_check(&ec->transform_core.parent.matrix,
+ &parent->transform_core.result.matrix))
+ {
+ check = EINA_TRUE;
+ ec->transform_core.parent.matrix = parent->transform_core.result.matrix;
}
}
+ else if (ec->transform_core.parent.enable)
+ {
+ ec->transform_core.parent.enable = EINA_FALSE;
+ e_util_transform_matrix_load_identity(&ec->transform_core.parent.matrix);
+ check = EINA_TRUE;
+ }
return check;
}
E_API E_Client*
e_comp_wl_topmost_parent_get(E_Client *ec)
{
- E_Client *parent = NULL;
+ E_Client *parent;
- if (!ec->comp_data || !ec->comp_data->sub.data)
- return ec;
-
- parent = ec->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(ec);
while (parent)
{
- if (!parent->comp_data || !parent->comp_data->sub.data)
+ if (!e_comp_wl_subsurface_check(parent))
return parent;
- parent = parent->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(parent);
}
return ec;
{
E_Comp_Wl_Remote_Provider *provider;
E_Comp_Wl_Remote_Source *source = NULL;
- E_Comp_Wl_Subsurf_Data *sdata, *ssdata;
- E_Client *offscreen_parent;
+ E_Comp_Wl_Subsurf_Data *sdata;
+ E_Client *parent, *offscreen_parent;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(e_object_is_del(E_OBJECT(ec)), EINA_FALSE);
}
/* subsurface case */
- if ((sdata = ec->comp_data->sub.data))
+ if (e_comp_wl_subsurface_check(ec))
{
/* check for valid subcompositor data */
- if (!sdata->parent)
+ parent = e_comp_wl_subsurface_parent_get(ec);
+ if (!parent)
return EINA_FALSE;
- if (!sdata->parent->comp_data)
+ if (!parent->comp_data)
return EINA_FALSE;
- if (e_object_is_del(E_OBJECT(sdata->parent)))
+ if (e_object_is_del(E_OBJECT(parent)))
return EINA_FALSE;
- if (!(ssdata = sdata->parent->comp_data->sub.data))
+ if (!(sdata = parent->comp_data->sub.data))
return EINA_FALSE;
- if (!ssdata->remote_surface.offscreen_parent)
+ if (!sdata->remote_surface.offscreen_parent)
return EINA_FALSE;
- offscreen_parent = ssdata->remote_surface.offscreen_parent;
+ offscreen_parent = sdata->remote_surface.offscreen_parent;
provider = _remote_provider_find(offscreen_parent);
if (!provider) return EINA_FALSE;
return ec->comp_data ? !!ec->comp_data->sub.data : EINA_FALSE;
}
+EINTERN E_Client *
+e_comp_wl_subsurface_parent_get(E_Client *ec)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
+ /* Must be called with valid comp_data. */
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, NULL);
+ return ec->comp_data->sub.data ? ec->comp_data->sub.data->parent : NULL;
+}
+
static void
_e_comp_wl_subsurface_cb_dummy_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
{
EINTERN Eina_Bool e_comp_wl_normal_subsurface_has(E_Client *ec);
EINTERN void e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec);
EINTERN Eina_Bool e_comp_wl_subsurface_check(E_Client *ec);
+EINTERN E_Client *e_comp_wl_subsurface_parent_get(E_Client *ec);
#endif
static E_Client*
_topmost_parent_get(E_Client *ec)
{
- E_Client *parent = NULL;
+ E_Client *parent;
- if (!ec->comp_data || !ec->comp_data->sub.data)
- return ec;
-
- parent = ec->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(ec);
while (parent)
{
- if (!parent->comp_data || !parent->comp_data->sub.data)
+ if (!e_comp_wl_subsurface_check(parent))
return parent;
- parent = parent->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(parent);
}
return ec;
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
- new_parent = (ec->comp_data->sub.data) ? ec->comp_data->sub.data->parent : NULL;
+ new_parent = e_comp_wl_subsurface_parent_get(ec);
if (viewport->epc == new_parent) return;
{
E_EomOutputPtr eom_output = NULL;
E_Client *parent_ec = NULL, *output_ec = NULL;
- E_Comp_Wl_Client_Data *cdata = NULL, *parent_cdata = NULL;
Eina_List *l;
EINA_LIST_FOREACH(g_eom->eom_outputs, l, eom_output)
if (output_ec == ec) return eom_output;
- cdata = e_client_cdata_get(ec);
- if (!cdata) continue;
- if (!cdata->sub.data) continue;
-
- parent_ec = cdata->sub.data->parent;
+ parent_ec = e_comp_wl_subsurface_parent_get(ec);
while (parent_ec)
{
if (parent_ec == output_ec) return eom_output;
- parent_cdata = e_client_cdata_get(parent_ec);
- if (!parent_cdata) break;
- if (!parent_cdata->sub.data) break;
+ if (!e_comp_wl_subsurface_check(parent_ec)) break;
- parent_ec = parent_cdata->sub.data->parent;
+ parent_ec = e_comp_wl_subsurface_parent_get(parent_ec);
}
}
Eina_List *l;
E_EomClientPtr client;
E_Client *parent = NULL;
- E_Comp_Wl_Client_Data *cdata = NULL, *parent_cdata = NULL;
-
- cdata = e_client_cdata_get(ec);
- if (!cdata || !cdata->sub.data)
- return NULL;
EINA_LIST_FOREACH(g_eom->clients, l, client)
{
- parent = cdata->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(ec);
while (parent)
{
if (client->ec == parent)
return client;
- parent_cdata = e_client_cdata_get(parent);
- if (!parent_cdata || !parent_cdata->sub.data)
+ if (!e_comp_wl_subsurface_check(parent))
break;
- parent = parent_cdata->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(parent);
}
}
Eina_Bool need_sync = EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN(ec);
- if ((!ec->hwc_window) || (!ec->comp_data) || (!ec->comp_data->sub.data)) return;
+ if ((!ec->hwc_window) || (!e_comp_wl_subsurface_check(ec))) return;
state = e_hwc_window_accepted_state_get(ec->hwc_window);
if ((state != E_HWC_WINDOW_STATE_DEVICE) && (state != E_HWC_WINDOW_STATE_VIDEO))
return;
- parent = ec->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(ec);
while (parent)
{
state = e_hwc_window_accepted_state_get(parent->hwc_window);
break;
}
- if ((!parent->comp_data) || (!parent->comp_data->sub.data))
- break;
+ if (!e_comp_wl_subsurface_check(parent))
+ break;
- parent = parent->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(parent);
}
if (need_sync)
static const char*
_get_win_prop_Subsurface_Parent(const Evas_Object *evas_obj)
{
- const E_Comp_Wl_Client_Data *cdata;
- const E_Client *ec;
+ const E_Client *ec, *parent;
char *str = NULL;
ec = evas_object_data_get(evas_obj, "E_Client");
if (!ec->comp_data)
return strdup("None");
- cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
-
- if (asprintf(&str, "0x%zx", cdata->sub.data ? e_client_util_win_get(cdata->sub.data->parent) : 0) < 0)
+ parent = e_comp_wl_subsurface_parent_get((E_Client *)ec);
+ if (asprintf(&str, "0x%zx", parent ? e_client_util_win_get(parent) : 0) < 0)
return NULL;
return str;
!ec->comp_data->sub.below_list && !ec->comp_data->sub.below_list_pending)
continue;
win = e_client_util_win_get(ec);
- if (ec->comp_data->sub.data)
- parent = e_client_util_win_get(ec->comp_data->sub.data->parent);
+ if (e_comp_wl_subsurface_check(ec))
+ parent = e_client_util_win_get(e_comp_wl_subsurface_parent_get(ec));
buffer = e_pixmap_resource_get(ec->pixmap);
if (buffer)
buf_id = (buffer->resource) ? wl_resource_get_id(buffer->resource) : (WAYLAND_SERVER_RESOURCE_ID_MASK & 99999);
{
E_Client *ec;
E_Client *epc;
- E_Comp_Wl_Client_Data *cdata, *epc_cdata;
- E_Comp_Wl_Subsurf_Data *sdata;
+ E_Comp_Wl_Client_Data *epc_cdata;
ec = wl_resource_get_user_data(subsurf);
EINA_SAFETY_ON_NULL_RETURN(ec);
- cdata = e_client_cdata_get(ec);
- EINA_SAFETY_ON_NULL_RETURN(cdata);
-
- sdata = cdata->sub.data;
- EINA_SAFETY_ON_NULL_RETURN(sdata);
- epc = sdata->parent;
+ epc = e_comp_wl_subsurface_parent_get(ec);
EINA_SAFETY_ON_NULL_RETURN(epc);
epc_cdata = e_client_cdata_get(epc);
EINA_SAFETY_ON_NULL_RETURN(epc_cdata);
{
E_Process *pinfo = NULL;
E_Client *ec = NULL;
- E_Comp_Wl_Client_Data *cdata;
Eina_Bool freeze = EINA_TRUE;
Eina_List *l;
EINA_LIST_FOREACH(pinfo->ec_list, l, ec)
{
- cdata = e_client_cdata_get(ec);
- if (cdata &&
- cdata->sub.data &&
- cdata->sub.data->parent)
+ if ((e_comp_wl_subsurface_check(ec)) &&
+ (e_comp_wl_subsurface_parent_get(ec)))
continue;
if (ec->visible && !ec->iconic)
E_Client *ec, *parent = NULL;
ec = ecv->ec;
- if (!ec->comp_data || !ec->comp_data->sub.data)
+ if (!e_comp_wl_subsurface_check(ec))
return NULL;
- parent = ec->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(ec);
while (parent)
{
if (!parent->comp_data || !parent->comp_data->sub.data)
if (parent->comp_data->sub.data->remote_surface.offscreen_parent)
return parent->comp_data->sub.data->remote_surface.offscreen_parent;
- parent = parent->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(parent);
}
return NULL;
{
E_Client *parent = NULL;
- if (!ec->comp_data || !ec->comp_data->sub.data)
+ if (!e_comp_wl_subsurface_check(ec))
return NULL;
- parent = ec->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(ec);
while (parent)
{
- if (!parent->comp_data || !parent->comp_data->sub.data)
+ if (!e_comp_wl_subsurface_check(parent))
return NULL;
if (parent->comp_data->sub.data->remote_surface.offscreen_parent)
return parent->comp_data->sub.data->remote_surface.offscreen_parent;
- parent = parent->comp_data->sub.data->parent;
+ parent = e_comp_wl_subsurface_parent_get(parent);
}
return NULL;