Changed visibility calculation 58/43358/1 accepted/tizen/mobile/20150709.001524 accepted/tizen/tv/20150709.001537 accepted/tizen/wearable/20150709.001549 submit/tizen/20150708.100717
authorMinJeong Kim <minjjj.kim@samsung.com>
Wed, 8 Jul 2015 09:28:04 +0000 (18:28 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Wed, 8 Jul 2015 09:28:04 +0000 (18:28 +0900)
Calculation of visibility before client evaluation might miss latest changes
of clients and cause focus policy conflict (between new window and top stack).
so the calculation is better to be executed after client evaluation
and some callbacks of evas event(restack, move, resize).

Change-Id: I3f618b9f0877697111741c1eeab3e1fc2941a0ea
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_object.c

index 6b271a1..2e35164 100644 (file)
@@ -635,6 +635,8 @@ _e_client_del(E_Client *ec)
    if (e_pixmap_free(ec->pixmap))
      e_pixmap_client_set(ec->pixmap, NULL);
    ec->pixmap = NULL;
+
+   e_client_visibility_calculate();
 }
 
 ///////////////////////////////////////////
@@ -1419,6 +1421,8 @@ _e_client_cb_evas_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
      _e_client_hook_call(E_CLIENT_HOOK_MOVE_UPDATE, ec);
    e_remember_update(ec);
    ec->pre_cb.x = x; ec->pre_cb.y = y;
+
+   e_client_visibility_calculate();
 }
 
 static void
@@ -1459,6 +1463,8 @@ _e_client_cb_evas_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
      _e_client_hook_call(E_CLIENT_HOOK_RESIZE_UPDATE, ec);
    e_remember_update(ec);
    ec->pre_cb.w = w; ec->pre_cb.h = h;
+
+   e_client_visibility_calculate();
 }
 
 static void
@@ -1503,6 +1509,8 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
    if (ec->unredirected_single) return;
    e_remember_update(ec);
    _e_client_event_simple(ec, E_EVENT_CLIENT_STACK);
+
+   e_client_visibility_calculate();
 }
 
 ////////////////////////////////////////////////
@@ -2346,6 +2354,7 @@ _e_client_visibility_zone_calculate(E_Zone *zone)
 
         /* check e_client and skip e_clients not intersects with zone */
         if (!ec) continue;
+        if (e_object_is_del(E_OBJECT(ec))) continue;
         if (e_client_util_ignored_get(ec)) continue;
         if (ec->zone != zone) continue;
         if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
@@ -2447,13 +2456,11 @@ _e_client_visibility_zone_calculate(E_Zone *zone)
 }
 
 EAPI void
-e_client_visibility_calculate(E_Client *ec)
+e_client_visibility_calculate(void)
 {
    E_Zone *zone;
    Eina_List *zl;
 
-   if (e_object_is_del(E_OBJECT(ec))) return;
-
    EINA_LIST_FOREACH(e_comp->zones, zl, zone)
      {
         _e_client_visibility_zone_calculate(zone);
@@ -2491,9 +2498,6 @@ e_client_idler_before(void)
         if (client_type != _e_client_type_get(ec))
            _e_client_event_property(ec, E_CLIENT_PROPERTY_CLIENT_TYPE);
 
-        /* calculate visibility of the client" */
-        e_client_visibility_calculate(ec);
-
         /* PRE_POST_FETCH calls e_remember apply for new client */
         if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue;
         if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FETCH, ec)) continue;
@@ -2542,7 +2546,12 @@ e_client_idler_before(void)
           }
 
         if (ec->changed)
-          _e_client_eval(ec);
+          {
+             _e_client_eval(ec);
+
+             /* calculate visibility of clients */
+             e_client_visibility_calculate();
+          }
 
         if ((ec->changes.visible) && (ec->visible) && (!ec->changed))
           {
index 02965b4..d2afd7a 100644 (file)
@@ -914,7 +914,7 @@ EAPI Eina_Bool e_client_is_stacking(const E_Client *ec);
 EAPI Eina_Bool e_client_desk_window_profile_available_check(E_Client *ec, const char *profile);
 EAPI void      e_client_desk_window_profile_wait_desk_set(E_Client *ec, E_Desk *desk);
 EAPI void      e_client_layout_cb_set(E_Client_Layout_Cb cb);
-EAPI void      e_client_visibility_calculate(E_Client *ec);
+EAPI void      e_client_visibility_calculate(void);
 
 YOLO EAPI void e_client_focus_stack_set(Eina_List *l);
 
index f3d44d5..83dd1ef 100644 (file)
@@ -3679,7 +3679,7 @@ _e_comp_object_effect_end_cb(void *data, Evas_Object *obj, const char *emission,
    if (evas_object_data_get(cw->smart_obj, "effect_running"))
      {
         evas_object_data_del(cw->smart_obj, "effect_running");
-        e_client_visibility_calculate(cw->ec);
+        e_client_visibility_calculate();
      }
 
    end_cb = evas_object_data_get(obj, "_e_comp.end_cb");
@@ -3755,7 +3755,7 @@ e_comp_object_effect_stop(Evas_Object *obj, Edje_Signal_Cb end_cb)
    if (evas_object_data_get(cw->smart_obj, "effect_running"))
      {
         evas_object_data_del(cw->smart_obj, "effect_running");
-        e_client_visibility_calculate(cw->ec);
+        e_client_visibility_calculate();
      }
 }