e_comp_wl: add checking if e_comp->pointer is null 60/293360/1
authorduna.oh <duna.oh@samsung.com>
Mon, 22 May 2023 05:44:29 +0000 (14:44 +0900)
committerduna.oh <duna.oh@samsung.com>
Thu, 25 May 2023 02:22:11 +0000 (11:22 +0900)
Change-Id: I9967ef30abb72dd97d59f2bc65b3287e06e3f576

src/bin/e_comp_wl.c
src/bin/e_pointer.c

index f01186dfea6fdd685842ec97b160cc92a10ca765..29d0c7d3e75e6dab59d685324afd25a1a7b97e3f 100644 (file)
@@ -933,7 +933,8 @@ _e_comp_wl_cursor_reload(E_Client *ec)
    uint32_t serial;
    int cx, cy, px, py;
 
-   if (e_comp->pointer->o_ptr && (!evas_object_visible_get(e_comp->pointer->o_ptr)))
+   if (e_comp->pointer && e_comp->pointer->o_ptr &&
+       !evas_object_visible_get(e_comp->pointer->o_ptr))
      e_pointer_object_set(e_comp->pointer, NULL, 0, 0);
 
    if (!ec) return;
@@ -1895,8 +1896,7 @@ e_comp_wl_feed_focus_in(E_Client *ec)
       ecore_timer_add(((e_config->xkb.delay_held_key_input_to_focus)/1000.0),
                       (Ecore_Task_Cb)_e_comp_wl_evas_cb_focus_in_timer, ec);
    int rotation = ec->e.state.rot.ang.curr;
-   if (e_comp->pointer->rotation != rotation)
-     e_pointer_rotation_set(e_comp->pointer, rotation);
+   e_pointer_rotation_set(e_comp->pointer, rotation);
 }
 
 static void
@@ -2524,8 +2524,7 @@ _e_comp_wl_cb_client_rot_change_end(void *d EINA_UNUSED, int t EINA_UNUSED, E_Ev
    if (!focused_ec) return ECORE_CALLBACK_PASS_ON;
 
    rotation = focused_ec->e.state.rot.ang.curr;
-   if (e_comp->pointer->rotation != rotation)
-     e_pointer_rotation_set(e_comp->pointer, rotation);
+   e_pointer_rotation_set(e_comp->pointer, rotation);
 
    return ECORE_CALLBACK_PASS_ON;
 }
index 5beca85c26041bf561fb80993c727285cc6f3e02..8fdce911f4e49cd1678251cbee67677b3372d039 100644 (file)
@@ -414,6 +414,7 @@ e_pointer_rotation_set(E_Pointer *ptr, int rotation)
    const Eina_List *l;
    E_Input_Device *dev;
 
+   EINA_SAFETY_ON_NULL_RETURN(ptr);
    if (ptr->rotation == rotation) return;
 
    ptr->rotation = rotation;