e_client, e_comp_object: add focus second set and call it when window show without... 71/206771/3 accepted/tizen/5.0/unified/20190527.064629 submit/tizen_5.0/20190524.114112
authorJunseok, Kim <juns.kim@samsung.com>
Fri, 24 May 2019 11:07:43 +0000 (20:07 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Fri, 24 May 2019 11:39:14 +0000 (20:39 +0900)
There is a bug that latest focused window can't take focus.
When two or more windows are fully obscured by 24bit color fullsize window, the above window disappears then one of window(A) take focus and the other window set latest focused window(B).
In this situation, another window showing and hide, then below latest focused window(A) has lose focus and the other window(B) takes focus.
For solve the problem, if the window can't take when showing, that the windows focus_stack sets right behind of existing focused window.

Change-Id: Ib5da9166c17841024d86d4eb3214308827f9eacf

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_object.c

index 7774a1f10f074f33cd0e120a04287c36b5f62f6d..84918316251fb8030ae2048637237247641240de 100644 (file)
@@ -4936,6 +4936,29 @@ e_client_focus_latest_set(E_Client *ec)
    focus_stack = eina_list_prepend(focus_stack, ec);
 }
 
+EINTERN void
+e_client_focus_second_set(E_Client *ec)
+{
+   Eina_List *l = NULL;
+   E_Client *temp_ec = NULL;
+
+   if (!ec) CRI("ACK");
+   if (focus_track_frozen > 0) return;
+
+   focus_stack = eina_list_remove(focus_stack, ec);
+
+   EINA_LIST_FOREACH(focus_stack, l, temp_ec)
+     {
+        if (temp_ec != focused) continue;
+
+        focus_stack = eina_list_append_relative_list(focus_stack, ec, l);
+        return;
+     }
+
+   focus_stack = eina_list_prepend(focus_stack, ec);
+   return;
+}
+
 E_API void
 e_client_raise_latest_set(E_Client *ec)
 {
index 5397a364e0bc2740a0637355819499143b73a2b0..213467bedbeebc0c72bd890865c76169c7978ddb 100644 (file)
@@ -1059,6 +1059,7 @@ E_API void e_client_hook_del(E_Client_Hook *ch);
 E_API E_Client_Intercept_Hook *e_client_intercept_hook_add(E_Client_Intercept_Hook_Point hookpoint, E_Client_Intercept_Hook_Cb func, const void *data);
 E_API void e_client_intercept_hook_del(E_Client_Intercept_Hook *ch);
 E_API void e_client_focus_latest_set(E_Client *ec);
+EINTERN void e_client_focus_second_set(E_Client *ec);
 E_API void e_client_raise_latest_set(E_Client *ec);
 E_API void e_client_focus_defer_set(E_Client *ec);
 E_API void e_client_focus_defer_unset(E_Client *ec);
index 8e825f31055697691cfee70a37cc36feaf64943d..3e2adc525140f14399e29adc02790c3915afdb9a 100644 (file)
@@ -2180,7 +2180,7 @@ _e_comp_intercept_show_helper(E_Comp_Object *cw)
           {
              if (cw->ec->exp_iconify.not_raise &&
                  e_client_check_above_focused(cw->ec))
-               e_client_focus_latest_set(cw->ec);
+               e_client_focus_second_set(cw->ec);
              else
                e_client_focus_defer_set(cw->ec);
           }