e_policy_stack: add code to check transient_for order 21/264721/1 accepted/tizen/6.5/unified/20211028.224524 accepted/tizen/unified/20211001.001357 submit/tizen/20210929.031136 submit/tizen_6.5/20211028.163301 tizen_6.5.m2_release
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 29 Sep 2021 02:08:17 +0000 (11:08 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 29 Sep 2021 02:08:21 +0000 (11:08 +0900)
There was a bug that the transient_for children stack was incorrect.

1. Win_C1 set transient_for to Win_P already
2. Create Win_C2
3. Set Win_C2's transient_for to Win_P
4. Show Win_C2
5. Set Win_C1's transient_for to Win_P again

Above scenario, We exptected the window stack as below.
[Top]  Win_C1 -> Win_C2 -> Win_P  [Bottom]
But, window stack was Win_C2 -> Win_C1 -> Win_P.

This will fix this issue.

Change-Id: I1048bf5bbb492f52db5423ee610c2afe0e8e7097

src/bin/e_policy_stack.c

index e05ca01..05fdb6c 100644 (file)
@@ -129,6 +129,17 @@ _e_policy_stack_transient_for_apply(E_Client *ec)
                             top = e_client_below_get(top);
                             continue;
                          }
+                       else
+                         {
+                            // check transient_for stack
+                            int ec_id = eina_list_data_idx(ec->parent->transients, ec);
+                            int top_id = eina_list_data_idx(ec->parent->transients, top);
+                            if (ec_id < top_id)
+                              {
+                                 top = e_client_below_get(top);
+                                 continue;
+                              }
+                         }
                     }
                   if (top->transient_for_always_on_top)
                     {