Revert "subsurface: Do not update stacking order of entire sub-surface tree." 43/246843/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:52:08 +0000 (20:52 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 4 Nov 2020 11:52:16 +0000 (20:52 +0900)
This reverts commit 3d028b1c348ab53170b4f6e70ebe0794de14ff8d.

Change-Id: Id5f8d6ee29e289119fc107c6977b431139389664

src/bin/e_comp_wl.c
src/bin/e_comp_wl_subsurface.c

index fcd2c94..6a1168c 100644 (file)
@@ -4364,8 +4364,9 @@ e_comp_wl_surface_commit(E_Client *ec)
 
    if (e_comp_wl_subsurface_order_commit(ec))
      {
-        e_comp_wl_subsurface_restack(ec);
-        e_comp_wl_subsurface_restack_bg_rectangle(ec);
+        E_Client *topmost = e_comp_wl_topmost_parent_get(ec);
+        e_comp_wl_subsurface_restack(topmost);
+        e_comp_wl_subsurface_restack_bg_rectangle(topmost);
      }
 
    if (!e_pixmap_usable_get(ec->pixmap))
index 688cc55..aa9991c 100644 (file)
@@ -328,14 +328,17 @@ _e_comp_wl_subsurface_invisible_parent_get(E_Client *ec)
 static Eina_Bool
 _e_comp_wl_subsurface_order_commit(E_Client *ec)
 {
-   E_Client *subc;
+   E_Client *subc, *epc;
    Eina_List *l;
+   Eina_Bool need_restack = EINA_FALSE;
 
    if (!ec->comp_data) return EINA_FALSE;
 
-   if (!ec->comp_data->sub.list_changed)
-     return EINA_FALSE;
+   if (ec->comp_data->sub.data && (epc = ec->comp_data->sub.data->parent))
+     if (epc->comp_data->sub.list_changed)
+       need_restack = _e_comp_wl_subsurface_order_commit(epc);
 
+   if (!ec->comp_data->sub.list_changed) return (EINA_FALSE | need_restack);
    ec->comp_data->sub.list_changed = EINA_FALSE;
 
    /* TODO: need to check more complicated subsurface tree */
@@ -463,8 +466,9 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
 
    if (_e_comp_wl_subsurface_order_commit(ec))
      {
-        _e_comp_wl_subsurface_restack(ec);
-        _e_comp_wl_subsurface_restack_bg_rectangle(ec);
+        E_Client *topmost = e_comp_wl_topmost_parent_get(ec);
+        _e_comp_wl_subsurface_restack(topmost);
+        _e_comp_wl_subsurface_restack_bg_rectangle(topmost);
      }
 
    sdata->cached.has_data = EINA_FALSE;
@@ -1219,8 +1223,19 @@ e_comp_wl_subsurface_restack_bg_rectangle(E_Client *ec)
 EINTERN void
 e_comp_wl_subsurface_restack(E_Client *ec)
 {
+   E_Client *topmost;
+
    EINA_SAFETY_ON_NULL_RETURN(ec);
 
+   topmost = e_comp_wl_topmost_parent_get(ec);
+   if (topmost != ec)
+     {
+        ELOGF("SUB-COMP",
+              "WARN: This API is only for topmost parent, not sub-surface.",
+              ec);
+        return;
+     }
+
    _e_comp_wl_subsurface_restack(ec);
 }