e_policy: force render for uniconified client having unused shm buffer 46/91246/3
authorMinJeong Kim <minjjj.kim@samsung.com>
Thu, 6 Oct 2016 10:49:27 +0000 (19:49 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Thu, 6 Oct 2016 12:40:07 +0000 (21:40 +0900)
 If there are clients not supporting iconify state change events, those
clients can request wl_surface@commit anytime after being iconfied. but
wl_surface@commit for iconified clients having shm buffer doesn't affect to
its comp object rendering because the comp object is invisible.
 And even if the client is uniconified, it can be never composited if the client
doesn't send new wl_surface@attach.
 So, wl_callback@done is never sent to client as well, and it's possible to
cause block of client-side rendering.

 To resolve the problem, we need to do force render for uniconified client
having unused shm buffer.

Change-Id: I9d227c3a27b5cdaa1b773a174e772f01ed338886
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_policy.c
src/bin/e_policy_wl.c
src/bin/e_policy_wl.h

index 917246a2dec09d7c347db75fa876ffd878cbe2be..3636dfd0ec86580ad94cfff0f3e316f536d724d2 100644 (file)
@@ -838,6 +838,26 @@ _e_policy_cb_hook_client_visibility(void *d EINA_UNUSED, E_Client *ec)
      }
 }
 
+static void
+_e_policy_cb_hook_client_uniconify(void *d EINA_UNUSED, E_Client *ec)
+{
+   if (e_object_is_del(E_OBJECT(ec))) return;
+   if (!e_policy_wl_iconify_state_supported_get(ec))
+     {
+        ELOGF("TZPOL", "Force Update the client not supporting iconify state",
+              ec->pixmap, ec);
+
+        /* force render for an iconifed e_client having shm buffer not used yet*/
+        if ((e_pixmap_image_data_get(ec->pixmap)) &&
+            (!e_pixmap_dirty_get(ec->pixmap)))
+          {
+             e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
+             e_comp_object_dirty(ec->frame);
+             e_comp_object_render(ec->frame);
+          }
+     }
+}
+
 static void
 _e_policy_cb_hook_pixmap_del(void *data EINA_UNUSED, E_Pixmap *cp)
 {
@@ -1746,6 +1766,7 @@ e_policy_init(void)
    E_CLIENT_HOOK_APPEND(hooks_ec,  E_CLIENT_HOOK_DESK_SET,            _e_policy_cb_hook_client_desk_set,            NULL);
    E_CLIENT_HOOK_APPEND(hooks_ec,  E_CLIENT_HOOK_FULLSCREEN_PRE,      _e_policy_cb_hook_client_fullscreen_pre,      NULL);
    E_CLIENT_HOOK_APPEND(hooks_ec,  E_CLIENT_HOOK_EVAL_VISIBILITY,     _e_policy_cb_hook_client_visibility,          NULL);
+   E_CLIENT_HOOK_APPEND(hooks_ec,  E_CLIENT_HOOK_UNICONIFY,           _e_policy_cb_hook_client_uniconify,           NULL);
 
    E_PIXMAP_HOOK_APPEND(hooks_cp,  E_PIXMAP_HOOK_DEL,                 _e_policy_cb_hook_pixmap_del,                 NULL);
    E_PIXMAP_HOOK_APPEND(hooks_cp,  E_PIXMAP_HOOK_UNUSABLE,            _e_policy_cb_hook_pixmap_unusable,            NULL);
index 876462de65261f8c1baadda24dba756d0dd25669..302a66f34678d9cc48dc66efac0a98955bcb257a 100644 (file)
@@ -1045,6 +1045,32 @@ e_policy_wl_visibility_send(E_Client *ec, int vis)
      polwl->pending_vis = eina_list_append(polwl->pending_vis, ec);
 }
 
+Eina_Bool
+e_policy_wl_iconify_state_supported_get(E_Client *ec)
+{
+   E_Policy_Wl_Tzpol *tzpol;
+   E_Policy_Wl_Surface *psurf;
+   E_Client *ec2;
+   Eina_List *l;
+   Eina_Iterator *it;
+   Eina_Bool found = EINA_FALSE;
+
+   it = eina_hash_iterator_data_new(polwl->tzpols);
+   EINA_ITERATOR_FOREACH(it, tzpol)
+      EINA_LIST_FOREACH(tzpol->psurfs, l, psurf)
+        {
+           ec2 = e_pixmap_client_get(psurf->cp);
+           if (ec2 == ec)
+             {
+                found = EINA_TRUE;
+                break;
+             }
+        }
+   eina_iterator_free(it);
+
+   return found;
+}
+
 void
 e_policy_wl_iconify_state_change_send(E_Client *ec, int iconic)
 {
index a9a3573efc626351a428a13f707c6231c2218364..74bfc4068de80e4ba4c34c3093e6b02e77d5b544 100644 (file)
@@ -15,6 +15,7 @@ void      e_policy_wl_pixmap_del(E_Pixmap *cp);
 void      e_policy_wl_visibility_send(E_Client *ec, int vis);
 
 /* iconify */
+Eina_Bool e_policy_wl_iconify_state_supported_get(E_Client *ec);
 void      e_policy_wl_iconify_state_change_send(E_Client *ec, int iconic);
 
 /* position */