e_comp_wl: 'below_obj' has to be deleted if it was created before subsurface. 11/209311/1 accepted/tizen/5.0/unified/20190705.041558 submit/tizen_5.0/20190705.005729
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 4 Jul 2019 23:52:57 +0000 (08:52 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Thu, 4 Jul 2019 23:52:57 +0000 (08:52 +0900)
If 'below_obj' for 'E_Client' was created before it becomes subsurface,
then 'below_obj' has to be deleted.
Otherwise, it will cause undefined behavior.

Since 'below_obj' is to fill the background of toplevel surface which
wants to show opaque UI but submit buffers that has alpha channel for
overlay video, 'below_obj' obviously isn't for subsurface.

Change-Id: I7522d0b9b87f0aaf0011224bd950dd9727ecc12e

src/bin/e_comp_wl.c

index 22409abd1ddf7a830295a7d9857915d1314865af..559d44bccab97a4f206e2dfc98c37d9af060222f 100644 (file)
@@ -4158,6 +4158,10 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_
    e_comp->new_clients++;
    e_client_unignore(ec);
 
+   /* Delete 'below_obj' if it was created before 'E_Client' becomes subsurface.
+    * It's not for subsurface. */
+   E_FREE_FUNC(ec->comp_data->sub.below_obj, evas_object_del);
+
    _e_comp_wl_hook_call(E_COMP_WL_HOOK_SUBSURFACE_CREATE, ec);
    return EINA_TRUE;