Apply e_comp's interfaces
authorjinbong.lee <jinbong.lee@samsung.com>
Mon, 30 Sep 2024 12:27:50 +0000 (21:27 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 26 Nov 2024 10:13:14 +0000 (19:13 +0900)
Change-Id: I06d243fea275e14fbd884b0890d7f4bd28d60e44

src/e_mod_rdp.c

index 346eedb01eead99c107427a8f5229623452d2508..796ca69bedef766c925fc5fa6692e40ec1e4b9b6 100644 (file)
@@ -1041,6 +1041,7 @@ e_rdp_input_synchronize_event(rdpInput *input, UINT32 flags)
 static BOOL
 e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 {
+   E_Pointer *comp_pointer;
    int move_x = 0, move_y = 0;
    int motionless = 0;
    uint32_t button = 0;
@@ -1051,6 +1052,8 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 
    motionless = peerContext->rdpBackend->motionless;
 
+   if (!(comp_pointer = e_comp_pointer_get())) return FALSE;
+
    if (flags & PTR_FLAGS_MOVE && !motionless)
      {
         if (_e_rdp_check_input_region(output, x, y))
@@ -1059,19 +1062,19 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
 
              cal_x = _e_rdp_get_pointer_x(output, x);
              cal_y = _e_rdp_get_pointer_y(output, y);
-             if (output->e_pointer_prev_x == e_comp->pointer->x &&
-                 output->e_pointer_prev_y == e_comp->pointer->y)
+             if (output->e_pointer_prev_x == comp_pointer->x &&
+                 output->e_pointer_prev_y == comp_pointer->y)
                {
                   move_x = cal_x - output->cal_x_pre;
                   move_y = cal_y - output->cal_y_pre;
                }
              else
                {
-                  move_x = cal_x - e_comp->pointer->x;
-                  move_y = cal_y - e_comp->pointer->y;
+                  move_x = cal_x - comp_pointer->x;
+                  move_y = cal_y - comp_pointer->y;
                }
-             output->e_pointer_prev_x = e_comp->pointer->x;
-             output->e_pointer_prev_y = e_comp->pointer->y;
+             output->e_pointer_prev_x = comp_pointer->x;
+             output->e_pointer_prev_y = comp_pointer->y;
              output->cal_x_pre = cal_x;
              output->cal_y_pre = cal_y;
           }
@@ -1111,8 +1114,8 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
                {
                   cal_x = _e_rdp_get_pointer_x(output, x);
                   cal_y = _e_rdp_get_pointer_y(output, y);
-                  move_x = cal_x - e_comp->pointer->x;
-                  move_y = cal_y - e_comp->pointer->y;
+                  move_x = cal_x - comp_pointer->x;
+                  move_y = cal_y - comp_pointer->y;
                }
              e_info_server_input_mousegen(0, move_x, move_y, E_INFO_EVENT_STATE_MOTION);
              e_info_server_input_mousegen(button, move_x, move_y, state);
@@ -1527,7 +1530,7 @@ e_rdp_backend_destroy(void)
    b = g_rdp_backend;
    EINA_SAFETY_ON_NULL_RETURN(b);
 
-   evas_event_callback_del(e_comp->evas, EVAS_CALLBACK_RENDER_POST, _e_rdp_canvas_render_post);
+   evas_event_callback_del(e_comp_evas_get(), EVAS_CALLBACK_RENDER_POST, _e_rdp_canvas_render_post);
 
    if (b->handlers)
      {
@@ -1627,7 +1630,7 @@ e_rdp_backend_create(E_Rdp_Conf_Edd *config)
    E_LIST_HANDLER_APPEND(b->handlers, E_EVENT_CLIENT_BUFFER_CHANGE, _e_rdp_cb_client_buffer_change, g_rdp_backend);
    E_LIST_HANDLER_APPEND(b->handlers, E_EVENT_CLIENT_UNICONIFY, _e_rdp_cb_client_uniconify, g_rdp_backend);
 
-   evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_POST, _e_rdp_canvas_render_post, NULL);
+   evas_event_callback_add(e_comp_evas_get(), EVAS_CALLBACK_RENDER_POST, _e_rdp_canvas_render_post, NULL);
 
    g_rdp_backend = b;