e_comp_wl_subsurface: 'below_obj' has to be deleted if it was created before subsurface. 08/209308/1 accepted/tizen/unified/20190705.110745 submit/tizen/20190704.234143
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 4 Jul 2019 05:53:18 +0000 (14:53 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Thu, 4 Jul 2019 21:34:40 +0000 (06:34 +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: Ica92d9775b42fda5218e84a820f17cf05301f9f8

src/bin/e_comp_wl_subsurface.c

index e1c3b2013b43499e26e41346fbac67fb63f26d31..71c2adf155f1dc478fa8a583b8b748f7ba349f2a 100644 (file)
@@ -944,6 +944,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;