refactoring: change code to use E_APIs to access the E_Comp_Wl_Client_Data structure
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 11 Sep 2024 08:24:16 +0000 (17:24 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 19 Sep 2024 06:04:24 +0000 (15:04 +0900)
Change-Id: I28a073a3238a8de569918b533ba9cce8e3cb5ac4

src/e_mod_gesture_events.c
src/e_mod_main.c

index 862706aed6dc89ae6791285c69673d889f9c59ee..75391f71297e272e7dc3d2ed672f11d892ba397f 100644 (file)
@@ -259,9 +259,8 @@ _e_gesture_util_eclient_surface_get(E_Client *ec)
 {
    if (!ec) return NULL;
    if (e_object_is_del(E_OBJECT(ec))) return NULL;
-   if (!ec->comp_data) return NULL;
 
-   return ec->comp_data->surface;
+   return e_comp_wl_surface_get(ec);
 }
 
 static void
index f31458cd674ea09a55f708fb91e4f71944db9780..d1ced5bd60b5738ebae49060546ea7b29d1138e1 100644 (file)
@@ -1382,11 +1382,14 @@ _e_gesture_deactivate_list_set(struct wl_client *client, struct wl_resource *sur
              info->surfaces = eina_list_append(info->surfaces, surface);
              _e_gesture_deactivate_listener_add(client, surface);
              focused_ec = e_client_focused_get();
-             if (focused_ec && focused_ec->comp_data && focused_ec->comp_data->wl_surface &&
-                 surface == focused_ec->comp_data->wl_surface)
+             if (focused_ec)
                {
-                  info->active = EINA_FALSE;
-                  info->surface = surface;
+                  struct wl_resource *focused_surface = e_comp_wl_wl_surface_get(focused_ec);
+                  if (focused_surface && (focused_surface == surface))
+                    {
+                       info->active = EINA_FALSE;
+                       info->surface = surface;
+                    }
                }
              added = EINA_TRUE;
           }
@@ -1777,9 +1780,9 @@ _e_gesture_deactivate_surface_check(E_Client *ec)
    struct wl_resource *surface;
 
    EINA_SAFETY_ON_NULL_RETURN(ec);
-   EINA_SAFETY_ON_NULL_RETURN(ec->comp_data);
+   EINA_SAFETY_ON_NULL_RETURN(e_comp_wl_data_check(ec));
 
-   surface = ec->comp_data->wl_surface;
+   surface = e_comp_wl_wl_surface_get(ec);
    if (!surface) return;
 
    _e_gesture_deactivate_surface_list_check(surface, &gesture->gesture_events.edge_swipes.base.activation);
@@ -1819,7 +1822,7 @@ _e_gesture_cb_client_focus_in(void *data, int type, void *event)
    EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
    ec = ev->ec;
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, ECORE_CALLBACK_PASS_ON);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, ECORE_CALLBACK_PASS_ON);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl_data_check(ec), ECORE_CALLBACK_PASS_ON);
 
    _e_gesture_window_gesture_disabled_change(ec);
    _e_gesture_deactivate_surface_check(ec);
@@ -1833,8 +1836,8 @@ _e_gesture_cb_aux_hint_change(void *data EINA_UNUSED, E_Client *ec)
    E_Client *qp_ec;
    Eina_List *list, *l;
    Eina_Bool res_return = EINA_FALSE;
-   if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return;
-   if (!ec->comp_data->aux_hint.changed) return;
+   if (e_object_is_del(E_OBJECT(ec)) || !e_comp_wl_data_check(ec)) return;
+   if (!e_comp_wl_aux_hint_changed_get(ec)) return;
 
    list = e_service_quickpanels_get();
    EINA_LIST_FOREACH(list, l, qp_ec)