From: Seunghun Lee Date: Thu, 4 Apr 2024 02:01:21 +0000 (+0900) Subject: subsurface: Update position of comp object upon creation X-Git-Tag: accepted/tizen/8.0/unified/20240405.142131~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F309155%2F1;p=platform%2Fupstream%2Fenlightenment.git 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: Ifbb8c6254da06c9086a933657158f11bf12094b6 --- diff --git a/src/bin/e_compositor.c b/src/bin/e_compositor.c index 8e09ecac6e..7b41090ec4 100644 --- a/src/bin/e_compositor.c +++ b/src/bin/e_compositor.c @@ -82,6 +82,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); @@ -1333,6 +1334,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; @@ -1430,9 +1433,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