int w = 0;
int h = 0;
Eina_Bool check = EINA_FALSE;
- E_Comp_Wl_Client_Data *cdata;
if (!ec) return EINA_FALSE;
if (ec->frame)
evas_object_geometry_get(ec->frame, 0, 0, &w, &h);
- cdata = e_client_cdata_get(ec);
- if ((ec->transform_core.transform_list) &&
- (cdata && cdata->sub.below_obj))
- {
- E_Map *map_ = e_comp_object_map_get(cdata->sub.below_obj);
- if (!map_)
- check = EINA_TRUE;
- e_map_free(map_);
- }
-
// check client position or size change
if (ec->x != ec->transform_core.backup.client_x ||
ec->y != ec->transform_core.backup.client_y ||
cdata = e_client_cdata_get(ec);
if (!cdata) return;
- if (cdata->sub.below_obj)
- _e_client_transform_core_vertices_apply(ec, cdata->sub.below_obj, vertices, NULL);
-
EINA_LIST_FOREACH(cdata->sub.list, l, subc)
e_client_transform_core_update(subc);
ELOGF("TRANSFORM", "transform_core_sub_update_with_zoom, (zoom:%lf,%lf / coord:%d,%d)", ec, zoomx, zoomy, cx, cy);
- if (cdata->sub.below_obj)
- _e_client_transform_core_vertices_apply_with_zoom(ec, cdata->sub.below_obj, vertices, NULL, zoomx, zoomy, cx, cy);
-
EINA_LIST_FOREACH(cdata->sub.list, l, subc)
{
_e_client_transform_core_update_with_zoom(subc, zoomx, zoomy, cx, cy);
e_client_map_set(ec, map);
e_client_map_enable_set(ec, EINA_TRUE);
- if (cdata->sub.below_obj)
- {
- e_comp_object_map_set(cdata->sub.below_obj, map);
- e_comp_object_map_enable_set(cdata->sub.below_obj, EINA_TRUE);
- }
-
EINA_LIST_FOREACH(cdata->sub.list, l, subc)
_e_client_transform_sub_apply(subc, ec, zoom);
EINA_LIST_REVERSE_FOREACH(cdata->sub.below_list, l, subc)
e_client_map_enable_set(ec, EINA_FALSE);
e_client_map_set(ec, NULL);
- if (cdata->sub.below_obj)
- {
- e_comp_object_map_enable_set(cdata->sub.below_obj, EINA_FALSE);
- e_comp_object_map_set(cdata->sub.below_obj, NULL);
- }
-
EINA_LIST_FOREACH(cdata->sub.list, l, subc)
_e_client_transform_sub_apply(subc, ec, 1.0);
EINA_LIST_REVERSE_FOREACH(cdata->sub.below_list, l, subc)
_e_comp_wl_subsurface_restack(subc);
}
+static void
+_e_comp_wl_subsurface_bg_map_apply(E_Client *ec)
+{
+ E_Map *map = NULL, *new_map = NULL;
+ Eina_Bool enable;
+ int w, h;
+
+ if (e_object_is_del(E_OBJECT(ec))) return;
+ if (!ec->comp_data) return;
+ if (!ec->comp_data->sub.below_obj) return;
+ if (!ec->comp_data->sub.below_obj_map) return;
+
+ e_map_util_points_populate_from_object_full(ec->comp_data->sub.below_obj_map, ec->frame, 0);
+
+ evas_object_geometry_get(ec->comp_data->sub.below_obj, NULL, NULL, &w, &h);
+ e_map_point_image_uv_set(ec->comp_data->sub.below_obj_map, 0, 0, 0);
+ e_map_point_image_uv_set(ec->comp_data->sub.below_obj_map, 1, w, 0);
+ e_map_point_image_uv_set(ec->comp_data->sub.below_obj_map, 2, w, h);
+ e_map_point_image_uv_set(ec->comp_data->sub.below_obj_map, 3, 0, h);
+
+ enable = evas_object_map_enable_get(ec->frame);
+ if (enable)
+ map = e_comp_object_map_get(ec->frame);
+
+ if ((enable) && (map))
+ {
+ new_map = e_map_dup(map);
+ if (!new_map)
+ {
+ ERR("fail to dup e_map ec:%p", ec);
+ e_map_free(map);
+ return;
+ }
+
+ e_map_point_image_uv_set(new_map, 0, 0, 0);
+ e_map_point_image_uv_set(new_map, 1, w, 0);
+ e_map_point_image_uv_set(new_map, 2, w, h);
+ e_map_point_image_uv_set(new_map, 3, 0, h);
+
+ e_comp_object_map_set(ec->comp_data->sub.below_obj, new_map);
+ e_comp_object_map_enable_set(ec->comp_data->sub.below_obj, EINA_TRUE);
+ e_map_free(new_map);
+ }
+ else
+ {
+ e_comp_object_map_set(ec->comp_data->sub.below_obj, ec->comp_data->sub.below_obj_map);
+ e_comp_object_map_enable_set(ec->comp_data->sub.below_obj, EINA_TRUE);
+ }
+
+ if (map) e_map_free(map);
+}
+
static void
_e_comp_wl_subsurface_bg_evas_cb_resize(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
E_Client *ec;
if (!(ec = data)) return;
- if (e_object_is_del(E_OBJECT(ec))) return;
- if (!ec->comp_data) return;
- if (ec->comp_data->sub.below_obj)
- evas_object_resize(ec->comp_data->sub.below_obj, ec->w, ec->h);
+ _e_comp_wl_subsurface_bg_map_apply(ec);
+}
+
+static void
+_e_comp_wl_subsurface_bg_cb_hook_transform_change(void *data, E_Client *ec)
+{
+ _e_comp_wl_subsurface_bg_map_apply(ec);
}
static void
ec = e_comp_object_client_get(obj);
if ((ec) && (ec->comp_data))
- ec->comp_data->sub.below_obj = NULL;
+ {
+ ec->comp_data->sub.below_obj = NULL;
+ if (ec->comp_data->sub.below_obj_map)
+ {
+ e_map_free(ec->comp_data->sub.below_obj_map);
+ ec->comp_data->sub.below_obj_map = NULL;
+ }
+ E_FREE_FUNC(ec->comp_data->sub.below_obj_map_transform_hook, e_client_hook_del);
+ }
evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
_e_comp_wl_subsurface_bg_evas_cb_del);
_e_comp_wl_subsurface_below_obj_create(E_Client *ec)
{
Evas_Object *below_obj;
+ E_Map *below_obj_map;
short layer;
/* create a bg rectangle if topmost window is 24 depth window */
below_obj = evas_object_rectangle_add(e_comp->evas);
EINA_SAFETY_ON_NULL_RETURN(below_obj);
+ below_obj_map = e_map_new();
+ if (!below_obj_map)
+ {
+ ERR("Failed to new e_map ec:%p", ec);
+ evas_object_del(below_obj);
+ return;
+ }
+
/* This object doesn't care about mouse event. And It's also
* to avoid events of mouse on the E_Client. */
evas_object_pass_events_set(below_obj, EINA_TRUE);
*/
evas_object_color_set(below_obj, 0x00, 0x00, 0x00, 0x00);
evas_object_move(below_obj, ec->x, ec->y);
- evas_object_resize(below_obj, ec->w, ec->h);
+ evas_object_resize(below_obj, 1, 1);
evas_object_name_set(below_obj, "below_bg_rectangle");
+ ec->comp_data->sub.below_obj = below_obj;
+
+ ec->comp_data->sub.below_obj_map = below_obj_map;
+ ec->comp_data->sub.below_obj_map_transform_hook =
+ e_client_hook_add(E_CLIENT_HOOK_TRANSFORM_CHANGE,
+ _e_comp_wl_subsurface_bg_cb_hook_transform_change,
+ ec);
+
+ _e_comp_wl_subsurface_bg_map_apply(ec);
+
if (evas_object_visible_get(ec->frame))
evas_object_show(below_obj);
- ec->comp_data->sub.below_obj = below_obj;
-
ELOGF("COMP", " |bg_rectangle(%p) created", ec, below_obj);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_RESIZE,