focus: fixed bug for setting focus window while handling transient_for 83/102583/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Tue, 6 Dec 2016 06:41:27 +0000 (15:41 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 6 Dec 2016 06:41:27 +0000 (15:41 +0900)
Change-Id: I705b6343d20ee7c2ca73245a92d14eb8c9e3469d

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_policy_stack.c

index a7535fde1b8564dcc10566c0613421379081d736..5e1dc7d7966341fbd9a59f39ea47dc004c9dbd39 100644 (file)
@@ -2793,8 +2793,8 @@ _e_client_transient_for_group_make(E_Client *ec, Eina_List **list)
      }
 }
 
-static E_Client *
-_e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus)
+E_API E_Client *
+e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus)
 {
    E_Client *top_ec = NULL;
    Eina_List *transient_list = NULL;
@@ -4707,7 +4707,7 @@ e_client_activate(E_Client *ec, Eina_Bool just_do_it)
              E_Client *focus_ec = ec;
 
              if (ec->transients)
-               focus_ec = _e_client_transient_child_top_get(ec, EINA_TRUE);
+               focus_ec = e_client_transient_child_top_get(ec, EINA_TRUE);
 
              evas_object_focus_set(focus_ec->frame, 1);
           }
index ff5106bde35c0c8384e05b34e3ec8b92297ae165..30aa740e4383e12269c3bcee86c63061e179db0c 100644 (file)
@@ -1029,6 +1029,7 @@ E_API Eina_Bool e_client_has_xwindow(const E_Client *ec);
 E_API Eina_Bool e_client_desk_window_profile_available_check(E_Client *ec, const char *profile);
 E_API void      e_client_desk_window_profile_wait_desk_set(E_Client *ec, E_Desk *desk);
 E_API void      e_client_layout_cb_set(E_Client_Layout_Cb cb);
+E_API E_Client *e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus);
 E_API void      e_client_visibility_calculate(void);
 E_API void      e_client_visibility_skip_set(E_Client *ec, Eina_Bool skip);
 E_API void      e_client_post_raise_lower_set(E_Client *ec, Eina_Bool raise_set, Eina_Bool lower_set);
index b6fe02080951db0fbe74cca6c6eaf599af615734..8a2f71411deca80e062b67c0315a830313b89f2c 100644 (file)
@@ -134,6 +134,7 @@ _e_policy_stack_transient_for_tree_check(E_Client *child, E_Client *parent)
 void
 e_policy_stack_hook_pre_post_fetch(E_Client *ec)
 {
+   E_Client *new_focus = NULL;
    E_Policy_Stack *ps;
    ps = eina_hash_find(hash_pol_stack, &ec);
 
@@ -147,6 +148,16 @@ e_policy_stack_hook_pre_post_fetch(E_Client *ec)
              else
                ps->transient.win = ec->icccm.transient_for;
 
+             if (ec->parent)
+               {
+                  if (ec->parent == e_client_focused_get())
+                    {
+                       new_focus = e_client_transient_child_top_get(ec->parent, EINA_TRUE);
+                       if (new_focus)
+                         evas_object_focus_set(new_focus->frame, 1);
+                    }
+               }
+
              ps->transient.fetched = 0;
           }
      }