subsurface: Fix messed up stack order of sub-surface 47/256947/5 accepted/tizen/unified/20210420.090121 submit/tizen/20210420.022611
authorSeunghun Lee <chwila927@gmail.com>
Thu, 15 Apr 2021 07:09:06 +0000 (16:09 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 19 Apr 2021 08:46:00 +0000 (08:46 +0000)
The stack order of sub-surface sometimes got messed up when re-stacking
main surfaces.

Thinking of the case as an example that placing a surface underneath
another surface that has sub-surfaces, it obviously wasn't enough to
re-arrange sub-surfaces stack order only for E_Client given by restack
callback function.

This patch fixes it by updating stack order not only for given E_Client,
but also for E_Clients neighbored with given E_Client.

Change-Id: I95f11c9998ed4f1729e7ca3583a4f41f5dc4edf8

src/bin/e_comp_wl_subsurface.c

index dbce48a024923d75ed60f1c25f9e434eca4c104c..457ae673306b278dd40ca895d72f61d9f5c885d8 100644 (file)
@@ -904,7 +904,7 @@ _e_comp_wl_subsurface_circular_reference_check(E_Client *ec, E_Client *parent)
 static void
 _e_comp_wl_subsurface_cb_comp_object_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
-   E_Client *ec;
+   E_Client *ec, *above, *below;
 
    ec = data;
    if ((!ec) || (!ec->comp_data))
@@ -917,6 +917,14 @@ _e_comp_wl_subsurface_cb_comp_object_restack(void *data, Evas *e EINA_UNUSED, Ev
      return;
 
    _e_comp_wl_subsurface_stack_update(ec);
+
+   above = e_client_above_get(ec);
+   if (above)
+     _e_comp_wl_subsurface_stack_update(above);
+
+   below = e_client_below_get(ec);
+   if (below)
+     _e_comp_wl_subsurface_stack_update(below);
 }
 
 static Eina_Bool