e_policy_visibility: flush all grabs when a new buffer is attached 22/263422/4
authorDoyoun Kang <doyoun.kang@samsung.com>
Thu, 2 Sep 2021 04:46:06 +0000 (13:46 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Thu, 2 Sep 2021 06:31:29 +0000 (15:31 +0900)
There was a bug that the window requested both uniconify and unmaximize(defered move),
then the timeout was occured.

We add a grab_list to maintain grabs which are waiting for changing buffer.
And we flush all grabs in the list when a buffer is changed.
This will resolve above problem.

Change-Id: I9f86323e5cd0484fd29e67dc8a684e2cb80c0592

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

index 3bee452..f653f7c 100644 (file)
@@ -874,7 +874,6 @@ _e_vis_client_cb_buffer_attach(void *data, int type EINA_UNUSED, void *event)
      goto renew;
 
    ec = vc->ec;
-   grab = vc->grab;
 
    VS_INF(ec, "FINISH Uniconify render(ev:%p, vc:%p, provider:%p)", ev->ec, vc->ec, provider_ec);
 
@@ -888,18 +887,22 @@ _e_vis_client_cb_buffer_attach(void *data, int type EINA_UNUSED, void *event)
         e_comp_object_render(ec->frame);
      }
 
-   if (vc->grab == grab)
-     vc->grab = NULL;
+   EINA_LIST_FREE(vc->wait_buf_attach_grab_list, grab)
+     {
+        E_FREE_FUNC(grab, _e_vis_grab_release);
+     }
+   vc->wait_buf_attach_grab_list = NULL;
 
-   E_FREE_FUNC(grab, _e_vis_grab_release);
    E_FREE_FUNC(vc->buf_attach, ecore_event_handler_del);
 renew:
    return ECORE_CALLBACK_PASS_ON;
 }
 
 static void
-_e_vis_client_buffer_attach_handler_add(E_Vis_Client *vc)
+_e_vis_client_buffer_attach_handler_add(E_Vis_Client *vc, E_Vis_Grab *grab)
 {
+   vc->wait_buf_attach_grab_list = eina_list_append(vc->wait_buf_attach_grab_list, grab);
+
    if (vc->buf_attach)
      return;
 
@@ -1160,6 +1163,9 @@ _e_vis_client_del(E_Vis_Client *vc)
 
    VS_DBG(vc->ec, "CLIENT DEL");
 
+   eina_list_free(vc->wait_buf_attach_grab_list);
+   vc->wait_buf_attach_grab_list = NULL;
+
    E_FREE_FUNC(vc->grab, _e_vis_grab_release);
    E_LIST_REVERSE_FREE(vc->job.grab_list, grab)
       grab->deleted = 1;
@@ -1484,8 +1490,8 @@ _e_vis_client_add_uniconify_render_pending(E_Vis_Client *vc, E_Vis_Job_Type type
    _e_vis_client_prepare_foreground_signal_emit(vc);
    vc->state = E_VIS_ICONIFY_STATE_RUNNING_UNICONIFY;
    VS_DBG(vc->ec, "\tUPDATE ICONIC STATE: %s", STATE_STR(vc));
-   vc->grab = _e_vis_client_grab_get(vc, type, __func__);
-   _e_vis_client_buffer_attach_handler_add(vc);
+   E_Vis_Grab *grab = _e_vis_client_grab_get(vc, type, __func__);
+   _e_vis_client_buffer_attach_handler_add(vc, grab);
 
    e_policy_wl_iconify_state_change_send(ec, 0);
    _e_pol_vis_hook_call(E_POL_VIS_HOOK_TYPE_UNICONIFY_RENDER_RUNNING, ec);
@@ -1502,8 +1508,8 @@ _e_vis_client_defer_move(E_Vis_Client *vc, E_Vis_Job_Type type)
    if (!vc) return EINA_FALSE;
 
    VS_DBG(vc->ec, "\tDEFER MOVE: %s", STATE_STR(vc));
-   vc->grab = _e_vis_client_grab_get(vc, type, __func__);
-   _e_vis_client_buffer_attach_handler_add(vc);
+   E_Vis_Grab *grab = _e_vis_client_grab_get(vc, type, __func__);
+   _e_vis_client_buffer_attach_handler_add(vc, grab);
 
    _e_vis_client_job_add(vc, type);
 
index ae491a8..e822035 100644 (file)
@@ -137,6 +137,7 @@ struct _E_Vis_Client
    E_Client             *wait_for_child; //who ec is waiting for its launching
 
    Ecore_Event_Handler  *buf_attach;
+   Eina_List            *wait_buf_attach_grab_list;
 
    struct
    {