Revert "subsurface: Add a function to link sub-surface to its parent." 40/246840/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:49:20 +0000 (20:49 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:50:39 +0000 (20:50 +0900)
This reverts commit 04f8ba7a72e18f4bc7113b654a0fa9dae4cabbd2.

Change-Id: Ia6bd0fa8146a65ecec1d8cba8a5ab2f200614c2b

src/bin/e_comp_wl_subsurface.c

index f2ba1bb..307ba2e 100644 (file)
@@ -15,7 +15,6 @@ static void       _e_comp_wl_subsurface_synchronized_commit(E_Client *ec);
 static void       _e_comp_wl_subsurface_remove_from_parent(E_Client *parent, E_Client *subc);
 static void       _e_comp_wl_subsurface_stack_update(E_Client *ec);
 static Eina_Bool  _e_comp_wl_subsurface_empty_check(E_Client *ec);
-static void       _e_comp_wl_subsurface_parent_link(E_Comp_Wl_Subsurf_Data *sdata, E_Client *subc, E_Client *epc);
 
 static void       _e_comp_wl_subsurface_cb_evas_restack(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
@@ -1027,6 +1026,7 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_
    sdata->cached_buffer_ref.buffer = NULL;
    sdata->resource = res;
    sdata->synchronized = EINA_TRUE;
+   sdata->parent = epc;
    sdata->remote_surface.offscreen_parent = offscreen_parent;
 
    /* set subsurface client properties */
@@ -1044,7 +1044,29 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_
    if (offscreen_parent)
      ELOGF("COMP", "         |offscreen_parent:%p", ec, offscreen_parent);
 
-   _e_comp_wl_subsurface_parent_link(sdata, ec, epc);
+   if (epc->frame)
+   {
+       E_Layer layer = e_client_layer_get(epc);
+       if (layer > E_LAYER_BOTTOM) e_client_layer_set(ec, layer);
+
+       if ((!_e_comp_wl_subsurface_data_get(epc)) &&
+           (_e_comp_wl_subsurface_empty_check(epc)))
+         {
+            /* Add a callback function for restacking of topmost. */
+            evas_object_event_callback_add(epc->frame,
+                                           EVAS_CALLBACK_RESTACK,
+                                           _e_comp_wl_subsurface_cb_evas_restack,
+                                           epc);
+         }
+   }
+
+   if (epc->comp_data)
+   {
+       /* append this client to the parents subsurface list */
+       epc->comp_data->sub.list_pending =
+           eina_list_append(epc->comp_data->sub.list_pending, ec);
+       epc->comp_data->sub.list_changed = EINA_TRUE;
+   }
 
    /* TODO: add callbacks ?? */
 
@@ -1476,36 +1498,3 @@ _e_comp_wl_subsurface_empty_check(E_Client *ec)
        (eina_list_count(ec->comp_data->sub.below_list) == 0) &&
        (eina_list_count(ec->comp_data->sub.below_list_pending) == 0));
 }
-
-static void
-_e_comp_wl_subsurface_parent_link(E_Comp_Wl_Subsurf_Data *sdata, E_Client *subc, E_Client *epc)
-{
-   E_Layer layer;
-
-   sdata->parent = epc;
-
-   if (epc->frame)
-     {
-        layer = e_client_layer_get(epc);
-        if (layer > E_LAYER_BOTTOM)
-          e_client_layer_set(subc, layer);
-
-        if ((!_e_comp_wl_subsurface_data_get(epc)) &&
-            (_e_comp_wl_subsurface_empty_check(epc)))
-          {
-             /* Add a callback function for restacking of topmost. */
-             evas_object_event_callback_add(epc->frame,
-                                            EVAS_CALLBACK_RESTACK,
-                                            _e_comp_wl_subsurface_cb_evas_restack,
-                                            epc);
-          }
-     }
-
-   if (epc->comp_data)
-     {
-        /* append this client to the parents subsurface list */
-        epc->comp_data->sub.list_pending =
-           eina_list_append(epc->comp_data->sub.list_pending, subc);
-        epc->comp_data->sub.list_changed = EINA_TRUE;
-     }
-}