e_client: add focus stack append and call it when window show without take focus. 29/209429/2 accepted/tizen/unified/20190708.052403 submit/tizen/20190708.013923
authorJunseok, Kim <juns.kim@samsung.com>
Mon, 8 Jul 2019 01:14:08 +0000 (10:14 +0900)
committerJunseok, Kim <juns.kim@samsung.com>
Mon, 8 Jul 2019 01:28:04 +0000 (10:28 +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: Id3cf2711477b7d27c1955e577ec40e2f18bfe26a
Signed-off-by: Junseok, Kim <juns.kim@samsung.com>
src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_object.c

index 04eb566..ac7f1db 100644 (file)
@@ -5087,6 +5087,29 @@ e_client_focus_latest_set(E_Client *ec)
    focus_stack = eina_list_prepend(focus_stack, ec);
 }
 
+EINTERN void
+e_client_focus_stack_append_current_focused(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_focus_defer_set(E_Client *ec)
 {
index 30071e1..383e15c 100644 (file)
@@ -1071,6 +1071,7 @@ E_API E_Client_Intercept_Hook *e_client_intercept_hook_add(E_Client_Intercept_Ho
 E_API void e_client_intercept_hook_del(E_Client_Intercept_Hook *ch);
 EINTERN void e_client_focus_stack_lower(E_Client *ec);
 E_API void e_client_focus_latest_set(E_Client *ec);
+EINTERN void e_client_focus_stack_append_current_focused(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);
 E_API Eina_Bool e_client_focus_track_enabled(void);
index 275b00f..6638112 100644 (file)
@@ -2224,7 +2224,7 @@ _e_comp_intercept_show_helper(E_Comp_Object *cw)
                {
                   if (ec->exp_iconify.not_raise &&
                       e_client_check_above_focused(ec))
-                    e_client_focus_latest_set(ec);
+                    e_client_focus_stack_append_current_focused(ec);
                   else
                     e_client_focus_defer_set(ec);
                }