From 0166c4cacc78f3b0eba9802822a1224153b87615 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Thu, 4 Apr 2024 11:01:21 +0900 Subject: [PATCH] subsurface: Update position of comp object upon creation Upon creation, the position of the comp object for a subsurface must be updated to ensure that the subsurface is positioned correctly based on its ancestral relationships. By doing so, the subsurface will be accurately placed according to the translated positions of its ancestor surfaces. Change-Id: Ie9324ffe0ae04b8df728f915c353df258cc565db --- src/bin/e_compositor.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/e_compositor.c b/src/bin/e_compositor.c index 5c77fda..6731ba4 100644 --- a/src/bin/e_compositor.c +++ b/src/bin/e_compositor.c @@ -91,6 +91,7 @@ static E_Subsurface *_e_subsurface_from_ds_subsurface(struct ds_subsurface *ds_s static void _e_subsurface_destroy(E_Subsurface *sub); static void _e_subsurface_commit(E_Subsurface *sub); static void _e_subsurface_place_below_parent(E_Subsurface *sub); +static void _e_subsurface_position_update(E_Subsurface *sub); static void _e_subsurface_cb_destroy(struct wl_listener *listener, void *data); static void _e_subsurface_cb_cached(struct wl_listener *listener, void *data); static void _e_subsurface_cb_request_move(struct wl_listener *listener, void *data); @@ -1339,6 +1340,8 @@ _e_subsurface_create(struct ds_subsurface *ds_subsurface, E_Surface *parent_surf epc, offscreen_parent); + _e_subsurface_position_update(sub); + ELOGF("SUBSURFACE", "Create: parent(%p)", surface->ec, epc); return sub; @@ -1439,9 +1442,8 @@ _e_subsurface_position_update(E_Subsurface *sub) E_Client *ec = sub->surface->ec; int x, y; - x = sub->base.parent->x + sub->base.position.x; - y = sub->base.parent->y + sub->base.position.y; - evas_object_move(ec->frame, x, y); + if (e_comp_wl_subsurface_global_coord_get(ec, &x, &y)) + evas_object_move(ec->frame, x, y); } static void -- 2.7.4