e_client: Rename pixmap_change to pixmap_replace 17/316317/1
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 16 Aug 2024 05:07:35 +0000 (14:07 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 19 Aug 2024 08:09:01 +0000 (17:09 +0900)
This is to reduce confusion.

Change-Id: I66ff3426feb1aaa1cae36e4acf2a0462d7dca12c

src/bin/core/e_client.c
src/bin/core/e_client_intern.h
src/bin/server/e_compositor.c

index 1a7b522..3dad06d 100644 (file)
@@ -5350,34 +5350,34 @@ e_client_transform_core_direct_render_set(E_Client *ec, Eina_Bool set)
    e_client_transform_core_update(ec);
 }
 
-EINTERN E_Pixmap *
-e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp)
+EINTERN void
+e_client_pixmap_replace(E_Client *ec, E_Pixmap *newcp)
 {
    E_Pixmap_Type oldtype, newtype;
    E_Pixmap *oldcp;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec->pixmap, NULL);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(newcp, NULL);
+   EINA_SAFETY_ON_NULL_RETURN(ec);
+   EINA_SAFETY_ON_NULL_RETURN(ec->pixmap);
+   EINA_SAFETY_ON_NULL_RETURN(newcp);
 
    oldcp = ec->pixmap;
 
    oldtype = e_pixmap_type_get(oldcp);
-   if (oldtype >= E_PIXMAP_TYPE_MAX) return NULL;
+   if (oldtype >= E_PIXMAP_TYPE_MAX) return;
 
    newtype = e_pixmap_type_get(newcp);
-   if (newtype >= E_PIXMAP_TYPE_MAX) return NULL;
+   if (newtype >= E_PIXMAP_TYPE_MAX) return;
 
    if (eina_hash_find(clients_hash[oldtype], &oldcp))
      eina_hash_del_by_key(clients_hash[oldtype], &oldcp);
    e_pixmap_client_set(oldcp, NULL);
+   e_pixmap_win_id_del(oldcp);
+   e_pixmap_free(oldcp);
 
    ec->pixmap = newcp;
    e_pixmap_client_set(newcp, ec);
 
    eina_hash_add(clients_hash[newtype], &newcp, ec);
-
-   return oldcp;
 }
 
 E_API void
index 598cb8b..bc077fa 100644 (file)
@@ -60,7 +60,7 @@ EINTERN E_Capture_Save_State e_client_image_save(E_Client *ec, const char *dir,
 
 EINTERN Eina_Bool e_client_base_output_resolution_rsm_update(E_Client *bind_ec, E_Client *provider_ec);
 
-EINTERN E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp);
+EINTERN void      e_client_pixmap_replace(E_Client *ec, E_Pixmap *newcp);
 
 EINTERN void      e_client_layout_geometry_set(E_Client *ec, int x, int y, unsigned int w, unsigned int h);
 
index 7d55e0e..3cf0b3f 100644 (file)
@@ -673,7 +673,6 @@ _e_comp_wl_client_usable_get(pid_t pid, E_Pixmap *ep)
     */
 
    E_Client *ec;
-   E_Pixmap *oldep;
 
    /* find launchscreen client list */
    ec = e_comp_launchscrn_ec_find_by_pid(pid);
@@ -688,12 +687,7 @@ _e_comp_wl_client_usable_get(pid_t pid, E_Pixmap *ep)
 
    e_comp_launchscrn_ec_remove(ec);
 
-   oldep = e_client_pixmap_change(ec, ep);
-   if (oldep)
-     {
-        e_pixmap_win_id_del(oldep);
-        e_pixmap_free(oldep);
-     }
+   e_client_pixmap_replace(ec, ep);
 
    if (ec->internal)
      ec->internal = 0;