Do not access directly enlightnement structure member variable 19/315419/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 2 Dec 2024 02:52:26 +0000 (11:52 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 2 Dec 2024 02:52:33 +0000 (11:52 +0900)
Change-Id: I51c2c9989d26f1a5fce77528e276fb6d7b62f41f
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/e_mod_rdp.c

index 1604778ec2129b78ed44079d8310d811141bfb06..897bfab6cdf1668e0d75375e5166f7beefd6b136 100644 (file)
@@ -1047,6 +1047,7 @@ e_rdp_mouse_event(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
    uint32_t button = 0;
    uint32_t state = 0;
    int cal_x = 0, cal_y = 0;
+   int pointer_x = 0, pointer_y = 0;
    E_Rdp_Peer_Context *peerContext = (E_Rdp_Peer_Context *)input->context;
    E_Rdp_Output *output = peerContext->rdpBackend->output;
 
@@ -1062,19 +1063,20 @@ 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 == comp_pointer->x &&
-                 output->e_pointer_prev_y == comp_pointer->y)
+             e_pointer_position_get(comp_pointer, &pointer_x, &pointer_y);
+             if (output->e_pointer_prev_x == pointer_x &&
+                 output->e_pointer_prev_y == pointer_y)
                {
                   move_x = cal_x - output->cal_x_pre;
                   move_y = cal_y - output->cal_y_pre;
                }
              else
                {
-                  move_x = cal_x - comp_pointer->x;
-                  move_y = cal_y - comp_pointer->y;
+                  move_x = cal_x - pointer_x;
+                  move_y = cal_y - pointer_y;
                }
-             output->e_pointer_prev_x = comp_pointer->x;
-             output->e_pointer_prev_y = comp_pointer->y;
+             output->e_pointer_prev_x = pointer_x;
+             output->e_pointer_prev_y = pointer_y;
              output->cal_x_pre = cal_x;
              output->cal_y_pre = cal_y;
           }
@@ -1114,8 +1116,9 @@ 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 - comp_pointer->x;
-                  move_y = cal_y - comp_pointer->y;
+                  e_pointer_position_get(comp_pointer, &pointer_x, &pointer_y);
+                  move_x = cal_x - pointer_x;
+                  move_y = cal_y - 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);