e_client: check ec->frame is visible when finding focusable ec in topmost focus policy 30/285330/1
authorJunseok Kim <juns.kim@samsung.com>
Wed, 7 Dec 2022 06:46:36 +0000 (15:46 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 9 Dec 2022 05:51:23 +0000 (14:51 +0900)
There was a bug that focus given to the iconified window that fully obscured by evas object hide (not unmap, called by E20 module).
When the evas object hide called, the window was uniconic state so that state of visibility client still be E_VIS_ICONIFY_STATE_UNICONIC.
But, the visibility of the window turn to fully obscured, and iconified by visibility.

Finally, the window has property as below:
 - stack was topmost window of normal layer
 - focused: true
 - visibility.obscured : fully obscured (2)
 - vc->state : E_VIS_ICONIFY_STATE_UNICONIC (1)
 - iconic : true (1)
 - exp_iconify.by_client : false (0)
 - ec->frame visible : false
 - ec->mapped : true

The window will be show again by next visibility calculate, but the window have to loose their focus in this time.
for fix this issue, do not give focus to the window when the evas object is not visible.

NOTE: This is only for topmost focus policy.
      In focus history policy case, the window will be show soon so that the window can take focus.

NOTE2: This patch replaces the patch 2b0f37d491a700fbec56e91618825cc2dedd5585,
       which patch is prevent issue in topmost focus policy.

Change-Id: I21a0e8fd8610f7aa878e616cfa671ea49c5811e9

src/bin/e_client.c

index 203b3394ddf46309fa3454f3a477ceab8f9f8d06..bc25e6bbc7d38e6a20a5c15f777596471747d376 100644 (file)
@@ -911,12 +911,12 @@ _e_client_focus_can_take(E_Client *ec)
         if (_e_client_check_really_iconified(ec))
           return EINA_FALSE;
 
-        if (!ec->iconic)
+        if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK)
           {
-             if (!evas_object_visible_get(ec->frame) &&
-                 (ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED))
+             if ((ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED) &&
+                !evas_object_visible_get(ec->frame))
                {
-                  ELOGF("FOCUS", "client is hideen, skip focus", ec);
+                  ELOGF("FOCUS", "client is hidden, skip focus", ec);
                   return EINA_FALSE;
                }
           }
@@ -941,6 +941,12 @@ _e_client_focus_can_take(E_Client *ec)
    above_ec = _e_client_check_fully_contain_by_above(ec, EINA_FALSE);
    if (!above_ec) return EINA_TRUE;
 
+   if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK)
+     {
+        if (!evas_object_visible_get(above_ec->frame))
+          return EINA_TRUE;
+     }
+
    child_ec = _e_client_check_obscured_by_children_group(ec);
    if (!child_ec) return EINA_FALSE;