if (!ec->frame) continue;
if (ec->visibility.skip) continue;
if (ec->is_cursor) continue;
- /* if ec is subsurface, skip this */
cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data) continue;
+ if (e_comp_wl_subsurface_check(ec)) continue;
if ((!ec->first_mapped) &&
(e_comp_object_content_type_get(ec->frame) == E_COMP_OBJECT_CONTENT_TYPE_INT_IMAGE)) continue;
E_Client *subc;
Eina_List *l;
- /* check if it's subsurface */
- if (cdata->sub.data) return;
+ if (e_comp_wl_subsurface_check(ec))
+ return;
/* check if it's different with current state */
if ((ec->transform.angle == angle) &&
e_client_base_output_resolution_update(E_Client *ec)
{
E_Appinfo *eai = NULL;
- E_Comp_Wl_Client_Data *cdata;
int configured_width, configured_height;
int width, height;
* Transform for subsurface will be applied when toplevel surface does by
* implementation of e_client_transform_core.
*/
- cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data) return EINA_FALSE;
+ if (e_comp_wl_subsurface_check(ec))
+ return EINA_FALSE;
configured_width = e_config->configured_output_resolution.w;
configured_height = e_config->configured_output_resolution.h;
evas_object_map_enable_set(ec->frame, enable);
return EINA_TRUE;
-}
\ No newline at end of file
+}
e_pixmap_size_get(ec->pixmap, &bw, &bh);
/* for subsurface, it should be swap 90 and 270 */
- if (cdata->sub.data)
+ if (e_comp_wl_subsurface_check(ec))
switch (transform)
{
case WL_OUTPUT_TRANSFORM_90: transform = WL_OUTPUT_TRANSFORM_270; break;
_e_comp_intercept_layer_set(void *data, Evas_Object *obj, int layer)
{
E_Comp_Object *cw = data;
- E_Comp_Wl_Client_Data *cdata, *child_cdata;
+ E_Comp_Wl_Client_Data *child_cdata;
unsigned int l = e_comp_canvas_layer_map(layer);
int oldraise;
e_comp_render_queue();
}
ec = e_client_above_get(cw->ec);
- cdata = e_client_cdata_get(ec);
/* skip subsurface: stacking subsurface is handled by e_comp_wl */
- while ((ec) && (cdata) && (cdata->sub.data))
+ while ((ec) && (e_comp_wl_subsurface_check(ec)))
ec = e_client_above_get(ec);
if (ec && (evas_object_layer_get(ec->frame) != evas_object_layer_get(obj)))
{
ec = e_client_below_get(cw->ec);
/* skip subsurface: stacking subsurface is handled by e_comp_wl */
- while ((ec) && (cdata) && (cdata->sub.data))
+ while ((ec) && (e_comp_wl_subsurface_check(ec)))
ec = e_client_below_get(ec);
if (ec && (evas_object_layer_get(ec->frame) == evas_object_layer_get(cw->smart_obj)))
{
if (!ec->comp_data) return WL_OUTPUT_TRANSFORM_NORMAL;
vp = &ec->comp_data->scaler.buffer_viewport;
- if (ec->comp_data->sub.data)
+ if (e_comp_wl_subsurface_check(ec))
return vp->buffer.transform;
buffer = ec->comp_data->buffer_ref.buffer;
if (!ec->comp_data) return WL_OUTPUT_TRANSFORM_NORMAL;
vp = &ec->comp_data->pending.buffer_viewport;
- if (ec->comp_data->sub.data)
+ if (e_comp_wl_subsurface_check(ec))
return vp->buffer.transform;
buffer = ec->comp_data->pending.buffer;
if (!ec) return ECORE_CALLBACK_PASS_ON;
if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_PASS_ON;
if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON;
- if (ec->comp_data->sub.data) return ECORE_CALLBACK_PASS_ON;
+ if (e_comp_wl_subsurface_check(ec)) return ECORE_CALLBACK_PASS_ON;
if (ec->e.state.rot.ang.next < 0) return ECORE_CALLBACK_PASS_ON;
vp = &ec->comp_data->scaler.buffer_viewport;
if (!ec) return ECORE_CALLBACK_PASS_ON;
if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_PASS_ON;
if (!ec->comp_data) return ECORE_CALLBACK_PASS_ON;
- if (ec->comp_data->sub.data) return ECORE_CALLBACK_PASS_ON;
+ if (e_comp_wl_subsurface_check(ec)) return ECORE_CALLBACK_PASS_ON;
vp = &ec->comp_data->scaler.buffer_viewport;
vp->wait_for_transform_change = 0;
cdata->shell.unmap(cdata->shell.surface);
}
else if ((ec->internal) ||
- (cdata->sub.data) ||
+ (e_comp_wl_subsurface_check(ec)) ||
(ec == e_comp_wl->drag_client))
{
ELOGF("COMP", "Try to unmap. Hide window. internal:%d, sub:%p, drag:%d",
if (!ec->comp_data->mapped)
{
if (ec->comp_data->shell.surface &&
- !ec->internal && !ec->comp_data->sub.data && !ec->remote_surface.provider)
+ !ec->internal && !e_comp_wl_subsurface_check(ec) && !ec->remote_surface.provider)
{
ELOGF("COMP", "Current unmapped. ATTACH buffer:%p", ec, buffer);
}
if (!ec->comp_data->mapped)
{
if (ec->comp_data->shell.surface && ec->comp_data->pending.new_attach &&
- !ec->internal && !ec->comp_data->sub.data && !ec->remote_surface.provider)
+ !ec->internal && !e_comp_wl_subsurface_check(ec) && !ec->remote_surface.provider)
{
ELOGF("COMP", "Current unmapped. COMMIT. pixmap_usable:%d", ec, e_pixmap_usable_get(ec->pixmap));
e_comp_wl_buffer_reference(&ec->comp_data->buffer_ref, buffer);
/* set usable early because shell module checks this */
- if (ec->comp_data->shell.surface || ec->comp_data->sub.data)
+ if (ec->comp_data->shell.surface || e_comp_wl_subsurface_check(ec))
e_pixmap_usable_set(ec->pixmap, (buffer != NULL));
e_pixmap_resource_set(ec->pixmap, buffer);
ELOGF("COMP", "Try to unmap2. Call shell.unmap.", ec);
ec->comp_data->shell.unmap(ec->comp_data->shell.surface);
}
- else if (ec->internal || ec->comp_data->sub.data ||
+ else if (ec->internal || e_comp_wl_subsurface_check(ec) ||
(ec == e_comp_wl->drag_client))
{
ELOGF("COMP", "Try to unmap2. Hide window. internal:%d, sub:%p, drag:%d",
Evas_Object *o;
E_Client *ec, *_ec;
E_Comp_Wl_Remote_Surface *surface, *parent = NULL;
- E_Comp_Wl_Client_Data *cdata;
Eina_List *l;
if (!provider) return;
if ((_ec->visibility.obscured != E_VISIBILITY_UNOBSCURED) &&
(_ec->visibility.obscured != E_VISIBILITY_PARTIALLY_OBSCURED))
continue;
- /* if _ec is subsurface, skip this */
- cdata = (E_Comp_Wl_Client_Data *)_ec->comp_data;
- if (cdata && cdata->sub.data) continue;
+ if (e_comp_wl_subsurface_check(_ec)) continue;
if (!E_INTERSECTS(_ec->x, _ec->y, _ec->w, _ec->h, ec->zone->x, ec->zone->y, ec->zone->w, ec->zone->h))
continue;
if (version >= TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_SINCE_VERSION)
{
- if ((ec->comp_data) && (ec->comp_data->sub.data))
+ if (e_comp_wl_subsurface_check(ec))
{
ERR("Subsurface could not be source client");
goto fail;
if (version >= TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_SINCE_VERSION)
{
- if ((provider_ec->comp_data) && (provider_ec->comp_data->sub.data))
+ if (e_comp_wl_subsurface_check(provider_ec))
{
ERR("Subsurface could not be source client");
goto fail;
ec->post_raise = EINA_FALSE;
}
- if (!ec->comp_data->sub.data)
+ if (!e_comp_wl_subsurface_check(ec))
{
if (ec->post_lower)
{
_e_comp_wl_subsurface_check_below_bg_rectangle(ec);
}
+EINTERN Eina_Bool
+e_comp_wl_subsurface_check(E_Client *ec)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+ return ec->comp_data ? !!ec->comp_data->sub.data : EINA_FALSE;
+}
+
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_video_subsurface_has(E_Client *ec);
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);
#endif
e_desk_geometry_set(E_Desk *desk, int x, int y, int w, int h)
{
E_Client *ec;
- E_Comp_Wl_Client_Data *cdata;
E_Maximize max;
Eina_List *l = NULL, *ll = NULL;
Evas_Object *m;
EINA_LIST_FOREACH(sd->clients, l, ec)
{
- cdata = e_client_cdata_get(ec);
/* even if the desktop geometry is chagned, the system partial windows such as virtual
* keyboard and clipboard should be placed at the bottom of the desktop. */
/* QUICK FIX */
{
continue;
}
- else if (cdata && cdata->sub.data)
+ else if (e_comp_wl_subsurface_check(ec))
{
continue;
}
{
E_Desk *desk;
E_Client *ec;
- E_Comp_Wl_Client_Data *cdata;
Eina_List *l;
int cx, cy;
double zoomx, zoomy;
EINA_LIST_FOREACH(sd->clients, l, ec)
{
- cdata = e_client_cdata_get(ec);
if ((ec->visibility.obscured == E_VISIBILITY_UNOBSCURED) ||
- (cdata && cdata->sub.data))
+ (e_comp_wl_subsurface_check(ec)))
_e_desk_client_zoom(ec, zoomx, zoomy, cx, cy);
}
void _e_desk_group_ec_geometry_apply(E_Desk_Group *edg, E_Client *ec)
{
- E_Comp_Wl_Client_Data *cdata;
E_Util_Transform *transform;
transform = ec->desk_group.transform;
if (!transform) return;
- // skip subsurface
- cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data)
+ if (e_comp_wl_subsurface_check(ec))
return;
e_util_transform_move(transform, edg->x, edg->y, 0);
}
esc = wl_resource_get_user_data(surface);
- if ((!esc->comp_data) ||
- (!esc->comp_data->sub.data))
+ if (!e_comp_wl_subsurface_check(esc))
{
wl_resource_post_error(exporter,
WTZ_EXPORTER_ERROR_INVALID_ROLE,
else
{
if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) continue;
- if (!ec->comp_data->sub.data &&
+ if (!e_comp_wl_subsurface_check(ec) &&
!ec->comp_data->sub.list && !ec->comp_data->sub.list_pending &&
!ec->comp_data->sub.below_list && !ec->comp_data->sub.below_list_pending)
continue;
{
E_Client *ec;
Evas_Object *o;
- E_Comp_Wl_Client_Data *cdata;
for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
{
if (!(ec->visibility.obscured == 0 || ec->visibility.obscured == 1)) continue;
if (!ec->frame) continue;
if (!evas_object_visible_get(ec->frame)) continue;
- /* if ec is subsurface, skip this */
- cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data) continue;
+ if (e_comp_wl_subsurface_check(ec)) continue;
return ec;
}
{
E_Client *ec;
Evas_Object *o;
- E_Comp_Wl_Client_Data *cdata;
for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
{
if (!(ec->visibility.obscured == 0 || ec->visibility.obscured == 1)) continue;
if (!ec->frame) continue;
if (!evas_object_visible_get(ec->frame)) continue;
- /* if ec is subsurface, skip this */
- cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data) continue;
+ if (e_comp_wl_subsurface_check(ec)) continue;
return ec;
}
if (ec->is_cursor) continue;
if (!ec->visible) continue;
if (!evas_object_visible_get(ec->frame)) continue;
+ if (e_comp_wl_subsurface_check(ec)) continue;
cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data) continue; /* skip subsurface */
if (cdata && !cdata->mapped) continue;
if (ec->iconic) continue;
e_client_geometry_get(ec, &x, &y, &w, &h);
Eina_Bool
e_policy_client_is_subsurface(E_Client *ec)
{
- E_Comp_Wl_Client_Data *cd;
-
E_OBJECT_CHECK_RETURN(ec, EINA_FALSE);
E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, EINA_FALSE);
- cd = (E_Comp_Wl_Client_Data *)ec->comp_data;
- if (cd && cd->sub.data)
+ if (e_comp_wl_subsurface_check(ec))
return EINA_TRUE;
return EINA_FALSE;
if (e_object_is_del(E_OBJECT(ec))) return;
- cdata = e_client_cdata_get(ec);
/* check if this surface is already a sub-surface */
- if (cdata && cdata->sub.data)
+ if (e_comp_wl_subsurface_check(ec))
{
wl_resource_post_error(resource,
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
}
/* ec's parent comes from another process */
+ cdata = e_client_cdata_get(ec);
if (cdata)
cdata->has_extern_parent = EINA_TRUE;
}
{
E_Client *ec;
Evas_Object *o;
- E_Comp_Wl_Client_Data *cdata;
int ex, ey, ew, eh;
o = evas_object_top_get(e_comp->evas);
(!eina_list_data_find(e_comp->launchscrns, ec)))
continue;
- /* if ec is subsurface, skip this */
- cdata = e_client_cdata_get(ec);
- if (cdata && cdata->sub.data) continue;
+ if (e_comp_wl_subsurface_check(ec)) continue;
e_client_geometry_get(ec, &ex, &ey, &ew, &eh);
if (!E_CONTAINS(ex, ey, ew, eh, zone->x, zone->y, zone->w, zone->h))