e_client: do not update the transform core of client if the render update lock is set 35/307035/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 22 Feb 2024 10:31:41 +0000 (19:31 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 4 Mar 2024 06:27:45 +0000 (15:27 +0900)
Change-Id: I223c9f97ed7d68bebf98a3622f390ebdd5018bff

src/bin/e_client.c
src/include/e_client.h

index 3951166..b0caf6c 100644 (file)
@@ -149,6 +149,7 @@ static Eina_Bool comp_grabbed = EINA_FALSE;
 
 static Eina_List *handlers = NULL;
 static Eina_List *hooks = NULL;
+static Eina_List *comp_hooks = NULL;
 
 static Ecore_Event_Handler *action_handler_mouse = NULL;
 static Ecore_Timer *action_timer = NULL;
@@ -2819,26 +2820,32 @@ _e_client_transform_core_vertices_apply_with_zoom(E_Client *ec,
                                         E_Util_Transform *transform,
                                         E_Util_Transform_Zoom zoom)
 {
-   E_Map *map = NULL;
+   E_Map *map = NULL, *current_map = NULL;
 
    if (!obj) return;
 
    if (vertices)
      {
-        map = _e_client_transform_core_map_new(obj, vertices, transform,
-                                               ec->transform_core.direct_render);
-        EINA_SAFETY_ON_NULL_RETURN(map);
+        if (!ec->transform_core.update_lock)
+          {
+             map = _e_client_transform_core_map_new(obj, vertices, transform,
+                                                    ec->transform_core.direct_render);
+             EINA_SAFETY_ON_NULL_RETURN(map);
+
+             e_map_util_zoom(map, zoom.zoom_x, zoom.zoom_y, zoom.cx, zoom.cy);
 
-        e_map_util_zoom(map, zoom.zoom_x, zoom.zoom_y, zoom.cx, zoom.cy);
+             e_comp_object_map_set(obj, map);
+          }
 
-        e_comp_object_map_set(obj, map);
+        current_map = e_comp_object_map_get(obj);
 
-        if (ec->transform_core.activate)
+        if ((ec->transform_core.activate) && (current_map))
           e_comp_object_map_enable_set(obj, EINA_TRUE);
         else
           e_comp_object_map_enable_set(obj, EINA_FALSE);
 
-        e_map_free(map);
+        if (map) e_map_free(map);
+        if (current_map) e_map_free(current_map);
      }
    else
      evas_object_map_enable_set(obj, EINA_FALSE);
@@ -2850,24 +2857,30 @@ _e_client_transform_core_vertices_apply(E_Client *ec,
                                         E_Util_Transform_Rect_Vertex *vertices,
                                         E_Util_Transform *transform)
 {
-   E_Map *map = NULL;
+   E_Map *map = NULL, *current_map = NULL;
 
    if (!obj) return;
 
    if (vertices)
      {
-        map = _e_client_transform_core_map_new(obj, vertices, transform,
-                                               ec->transform_core.direct_render);
-        EINA_SAFETY_ON_NULL_RETURN(map);
+        if (!ec->transform_core.update_lock)
+          {
+              map = _e_client_transform_core_map_new(obj, vertices, transform,
+                                                     ec->transform_core.direct_render);
+              EINA_SAFETY_ON_NULL_RETURN(map);
+
+              e_comp_object_map_set(obj, map);
+          }
 
-        e_comp_object_map_set(obj, map);
+        current_map = e_comp_object_map_get(obj);
 
-        if (ec->transform_core.activate)
+        if ((ec->transform_core.activate) && (current_map))
           e_comp_object_map_enable_set(obj, EINA_TRUE);
         else
           e_comp_object_map_enable_set(obj, EINA_FALSE);
 
-        e_map_free(map);
+        if (map) e_map_free(map);
+        if (current_map) e_map_free(current_map);
      }
    else
      evas_object_map_enable_set(obj, EINA_FALSE);
@@ -3067,6 +3080,28 @@ e_client_idler_before(Eina_Bool *check_focus)
    TRACE_DS_END();
 }
 
+static Eina_Bool
+_e_client_cb_hook_comp_render_update_lock_set(void *data, E_Client *ec)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_TRUE);
+
+   ec->transform_core.update_lock = EINA_TRUE;
+
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_e_client_cb_hook_comp_render_update_lock_unset(void *data, E_Client *ec)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_TRUE);
+
+   ec->transform_core.update_lock = EINA_FALSE;
+   ec->transform_core.changed = EINA_TRUE;
+
+   e_client_transform_core_update(ec);
+
+   return EINA_TRUE;
+}
 
 EINTERN Eina_Bool
 e_client_init(void)
@@ -3076,6 +3111,8 @@ e_client_init(void)
      clients_hash[pix_id] = eina_hash_pointer_new(NULL);
 
    E_COMP_WL_HOOK_APPEND(hooks, E_COMP_WL_HOOK_SHELL_SURFACE_READY, _e_client_cb_hook_shell_surface_ready, NULL);
+   E_COMP_COMP_HOOK_APPEND(comp_hooks, E_COMP_OBJECT_HOOK_RENDER_UPDATE_LOCK_SET, _e_client_cb_hook_comp_render_update_lock_set, NULL);
+   E_COMP_COMP_HOOK_APPEND(comp_hooks, E_COMP_OBJECT_HOOK_RENDER_UPDATE_LOCK_UNSET, _e_client_cb_hook_comp_render_update_lock_unset, NULL);
 
    E_EVENT_CLIENT_ADD = ecore_event_type_new();
    E_EVENT_CLIENT_REMOVE = ecore_event_type_new();
@@ -3114,6 +3151,7 @@ e_client_shutdown(void)
    for (pix_id = 0; pix_id < E_PIXMAP_TYPE_MAX; pix_id++)
      E_FREE_FUNC(clients_hash[pix_id], eina_hash_free);
 
+   E_FREE_LIST(comp_hooks, e_comp_object_hook_del);
    E_FREE_LIST(hooks, e_comp_wl_hook_del);
    E_FREE_LIST(handlers, ecore_event_handler_del);
 
index 1a434a3..5d2967a 100644 (file)
@@ -882,6 +882,7 @@ struct _E_Client
 
       Eina_Bool direct_render;
       Eina_Bool activate;
+      Eina_Bool update_lock;
    } transform_core;
 
    Ecore_Timer *map_timer;