defer move while unmaximizing client(to saved position) 88/114888/3 accepted/tizen/3.0/common/20170216.151558 accepted/tizen/3.0/ivi/20170216.060606 accepted/tizen/3.0/mobile/20170216.060432 accepted/tizen/3.0/tv/20170216.060501 accepted/tizen/3.0/wearable/20170216.060540 accepted/tizen/common/20170215.171145 accepted/tizen/ivi/20170216.094649 accepted/tizen/mobile/20170216.094552 accepted/tizen/tv/20170216.094609 accepted/tizen/wearable/20170216.094628 submit/tizen/20170215.124049 submit/tizen_3.0/20170215.124121
authorJuyeon Lee <juyeonne.lee@samsung.com>
Wed, 15 Feb 2017 10:50:22 +0000 (19:50 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Wed, 15 Feb 2017 12:22:01 +0000 (21:22 +0900)
   the code should propagate into new policy file.
   this is temperary fix for floating win set/unset issue that
   client is not ready with proper size of buffer commit but
   server restored floating win geometry to saved x,y

Change-Id: If816e246505f87052aaf3b8adf34dddeda8a2150

src/bin/e_client.c
src/bin/e_policy_visibility.c
src/bin/e_policy_visibility.h
src/bin/e_policy_visibility_internal.h

index 36f25408303900dba94463b25ca97afc8cee829a..c0b201ebc49a0f6e9c434437278958a1dda760aa 100644 (file)
@@ -5125,14 +5125,14 @@ e_client_unmaximize(E_Client *ec, E_Maximize max)
                   _e_client_frame_update(ec);
                   evas_object_smart_callback_call(ec->frame, "unmaximize", NULL);
                   e_client_resize_limit(ec, &w, &h);
-                  e_client_util_move_resize_without_frame(ec, x, y, w, h);
+                  e_policy_visibility_client_defer_move(ec, x, y);
                   e_hints_window_size_unset(ec);
                }
              else
                {
                   evas_object_smart_callback_call(ec->frame, "unmaximize", NULL);
                   e_client_resize_limit(ec, &w, &h);
-                  e_client_util_move_resize_without_frame(ec, x, y, w, h);
+                  e_policy_visibility_client_defer_move(ec, x, y);
                   e_hints_window_size_set(ec);
                }
              if (vert)
index 80050bc9c67f383d5185d3ab6e1b10c5adf66ed0..8992e2011c865673e2cd44a32e34a036a541fef5 100644 (file)
@@ -939,6 +939,22 @@ end:
   return EINA_TRUE;
 }
 
+static Eina_Bool
+_e_vis_client_defer_move(E_Vis_Client *vc, E_Vis_Job_Type type, int x, int y)
+{
+   if (!vc) return EINA_FALSE;
+
+   vc->state = E_VIS_ICONIFY_STATE_GEOMETRY_CHANGE;
+   vc->grab = _e_vis_client_grab_get(vc, __func__);
+   vc->defer.x = x;
+   vc->defer.y = y;
+   _e_vis_client_buffer_attach_handler_add(vc);
+
+   _e_vis_client_job_add(vc, type);
+
+   return EINA_TRUE;
+}
+
 static inline Eina_Bool
 _e_vis_ec_special_check(E_Client *ec)
 {
@@ -992,6 +1008,13 @@ _e_vis_ec_job_exec(E_Client *ec, E_Vis_Job_Type type)
 {
    VS_DBG(ec, "Job Run: type %d", type);
 
+   E_Vis_Client *vc = NULL;
+   if (ec) {
+        if (EINA_LIKELY(pol_vis != NULL)) {
+             vc = eina_hash_find(pol_vis->clients_hash, &ec);
+        }
+   }
+
    switch (type)
      {
       case E_VIS_JOB_TYPE_ACTIVATE:
@@ -1013,9 +1036,7 @@ _e_vis_ec_job_exec(E_Client *ec, E_Vis_Job_Type type)
          break;
       case E_VIS_JOB_TYPE_LAYER_LOWER:
          e_comp_canvas_norender_pop();
-         E_VIS_CLIENT_GET(vc, ec);
-         if (vc)
-           evas_object_layer_set(ec->frame, vc->layer);
+         if (vc) evas_object_layer_set(ec->frame, vc->layer);
          break;
       case E_VIS_JOB_TYPE_SHOW:
          /* checks for dectecting hide request after show request */
@@ -1024,6 +1045,14 @@ _e_vis_ec_job_exec(E_Client *ec, E_Vis_Job_Type type)
              (!ec->iconic) && (!ec->ignored))
            evas_object_show(ec->frame);
          break;
+      case E_VIS_JOB_TYPE_DEFER_MOVE:
+         /* handle defered job regarding move */
+         if (vc &&(!e_object_is_del(E_OBJECT(ec))) &&
+             (ec->visible) && (!ec->hidden) &&
+             (!ec->iconic) && (!ec->ignored))
+           evas_object_move(ec->frame, vc->defer.x, vc->defer.y);
+         break;
+
       default:
          VS_ERR(ec, "Unkown job type: %d", type);
          break;
@@ -1476,6 +1505,15 @@ e_policy_visibility_uniconify_render_disable_set(E_Client *ec, Eina_Bool disable
    vc->disable_uniconify_render = !!disable;
 }
 
+E_API void
+e_policy_visibility_client_defer_move(E_Client *ec, int x, int y)
+{
+   E_VIS_CLIENT_GET_OR_RETURN(vc, ec);
+   VS_DBG(ec, "API ENTRY | Defered Move");
+
+   _e_vis_client_defer_move(vc, E_VIS_JOB_TYPE_DEFER_MOVE, x, y);
+}
+
 E_API Eina_Bool
 e_policy_visibility_init(void)
 {
index ded14a12a2403bb4f4faeca3839e284e851e3a22..f8c17ba1538ca1b945a3b34f0f465ae458b811f7 100644 (file)
@@ -17,4 +17,6 @@ E_API E_Vis_Grab                 *e_policy_visibility_client_grab_get(E_Client *
 E_API void                        e_policy_visibility_client_grab_release(E_Vis_Grab *grab);
 E_API void                        e_policy_visibility_uniconify_render_disable_set(E_Client *ec, Eina_Bool disable);
 
+EINTERN void                      e_policy_visibility_client_defer_move(E_Client *ec, int x, int y);
+
 #endif
index 593d463bee13eb23fe5bf763b133d493490a96aa..27e8ef782c212685195fcddeec0dceb4d66b0be7 100644 (file)
@@ -93,6 +93,7 @@ typedef enum
    E_VIS_ICONIFY_STATE_ICONIC,
    E_VIS_ICONIFY_STATE_RUNNING_UNICONIFY,
    E_VIS_ICONIFY_STATE_RUNNING_UNICONIFY_WAITING_FOR_CHILD,
+   E_VIS_ICONIFY_STATE_GEOMETRY_CHANGE,
 } E_Vis_Iconify_State;
 
 typedef enum
@@ -105,6 +106,7 @@ typedef enum
    E_VIS_JOB_TYPE_UNICONIFY,
    E_VIS_JOB_TYPE_UNICONIFY_BY_VISIBILITY,
    E_VIS_JOB_TYPE_LAYER_LOWER,
+   E_VIS_JOB_TYPE_DEFER_MOVE,
 } E_Vis_Job_Type;
 
 /* external data structure */
@@ -152,6 +154,11 @@ struct _E_Vis_Client
    Eina_Bool prepare_emitted;
    Eina_Bool disable_uniconify_render;
    E_Layer layer;
+
+   struct
+   {
+      int          x, y, w, h;
+   } defer;
 };
 
 struct _E_Vis_Job_Group