e_comp_wl: reparent subsurface if it is child of remote surface provider 68/92768/5
authorMinJeong Kim <minjjj.kim@samsung.com>
Mon, 17 Oct 2016 11:29:11 +0000 (20:29 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 2 Nov 2016 02:03:15 +0000 (19:03 -0700)
Change-Id: I37a7cd02fb2c91e655d9f30c26c2e56fa49174cd
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_comp_wl.c
src/bin/e_comp_wl.h

index 27e93fa535908f577947af1db4026415633c660a..88b5c84ba643714a1aca9cdb1f20eee93811fb4c 100644 (file)
@@ -3701,6 +3701,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_
    struct wl_client *client;
    struct wl_resource *res;
    E_Comp_Wl_Subsurf_Data *sdata;
+   E_Client *offscreen_parent = NULL;
 
    /* try to get the wayland client from the surface resource */
    if (!(client = wl_resource_get_client(surface_resource)))
@@ -3710,6 +3711,13 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_
         return EINA_FALSE;
      }
 
+   // reparent remote surface provider's subsurfaces
+   if (epc->comp_data->remote_surface.onscreen_parent)
+     {
+        offscreen_parent = epc;
+        epc = epc->comp_data->remote_surface.onscreen_parent;
+     }
+
    // check parent relationship is a cycle
      {
         E_Client *parent = epc;
@@ -3758,6 +3766,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_
    sdata->resource = res;
    sdata->synchronized = EINA_TRUE;
    sdata->parent = epc;
+   sdata->remote_surface.offscreen_parent = offscreen_parent;
 
    /* set subsurface client properties */
    ec->borderless = EINA_TRUE;
@@ -4108,6 +4117,7 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec)
      evas_object_del(ec->comp_data->sub.below_obj);
 
    /* remove sub list */
+   /* TODO: if parent is set by onscreen_parent of remote surface? */
    EINA_LIST_FREE(ec->comp_data->sub.list, subc)
      if (subc->comp_data && subc->comp_data->sub.data) subc->comp_data->sub.data->parent = NULL;
    EINA_LIST_FREE(ec->comp_data->sub.list_pending, subc)
index 5302a17c35c3412777ea1c2d449ed9161d437e8c..89de838e2219c8bbcb4a70b8dbb6566682670c6f 100644 (file)
@@ -146,6 +146,11 @@ struct _E_Comp_Wl_Subsurf_Data
 
    Eina_Bool synchronized;
    Eina_Bool stand_alone;
+
+   struct
+     {
+        E_Client *offscreen_parent;
+     } remote_surface;
 };
 
 struct _E_Comp_Wl_Input_Device