e_client: fix focus issue 02/157702/4
authorDoyoun Kang <doyoun.kang@samsung.com>
Thu, 26 Oct 2017 02:03:05 +0000 (11:03 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Thu, 26 Oct 2017 07:45:55 +0000 (07:45 +0000)
There was a side effect on below patch. This patch fix it.
---------------------------------------
    e_client: fixed focus issue

    There was a bug that the focus is set to the top window when user touches the below window.
    in this case (user touches the window), touched window should be get the focus.
    This patch can resolve this issue.

    Change-Id: I090a1ed27b3f20081e4f69fc2a8f5461f6c7ff0d
----------------------------------------

Change-Id: I28840969f94595b8545b6ef36548fc0f7afe5798

src/bin/e_client.c

index c19473eeeeea652afa76c93e59344a566d9ebcd7..786cf159902eed4e49b63405dcb40bded8b83665 100644 (file)
@@ -3160,23 +3160,6 @@ _e_client_visibility_zone_calculate(E_Zone *zone, Eina_Bool check_focus)
                          canvas_vis = EINA_FALSE;
                     }
                }
-
-             if (ec->visibility.obscured == E_VISIBILITY_UNOBSCURED)
-               {
-                  if (!find_top_vis_ec)
-                    {
-                       find_top_vis_ec = EINA_TRUE;
-                       if ((!ec->iconic) &&
-                           (ec->icccm.accepts_focus || ec->icccm.take_focus))
-                         {
-                            if (E_CONTAINS(x, y, w, h, zone->x, zone->y, zone->w, zone->h))
-                              {
-                                 top_vis_full_ec = ec;
-                                 top_vis_full_ec_vis_changed = ec->visibility.changed;
-                              }
-                         }
-                    }
-               }
           }
         else
           {
@@ -3209,6 +3192,25 @@ _e_client_visibility_zone_calculate(E_Zone *zone, Eina_Bool check_focus)
                _e_client_event_simple(ec, E_EVENT_CLIENT_VISIBILITY_CHANGE);
 
              _e_client_hook_call(E_CLIENT_HOOK_EVAL_VISIBILITY, ec);
+
+             if (ec->visibility.obscured == E_VISIBILITY_UNOBSCURED)
+               {
+                  if (!find_top_vis_ec)
+                    {
+                       find_top_vis_ec = EINA_TRUE;
+                       if ((!ec->iconic) &&
+                           (ec->icccm.accepts_focus || ec->icccm.take_focus))
+                         {
+                            e_client_geometry_get(ec, &x, &y, &w, &h);
+                            if (E_CONTAINS(x, y, w, h, zone->x, zone->y, zone->w, zone->h))
+                              {
+                                 top_vis_full_ec = ec;
+                                 top_vis_full_ec_vis_changed = ec->visibility.changed;
+                              }
+                         }
+                    }
+               }
+
              ec->visibility.changed = 0;
 
              if (zone->display_state != E_ZONE_DISPLAY_STATE_OFF)