e_comp_wl: Move pointer during drag 05/293605/3
authorJunseok Kim <juns.kim@samsung.com>
Wed, 31 May 2023 06:24:55 +0000 (15:24 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 1 Jun 2023 08:50:04 +0000 (08:50 +0000)
There was a bug that pointer didn't move when dragging.
And there're another potential issue that send wl_pointer_motion even if wl_pointer_leave already sent.

for fix these issue, apply the following modifications.
- move pointer without drag state.
- send wl_pointer_motion when drag client is NULL.

Change-Id: I0fc866620571721fc43dbc421df0fc4a9d51cf24

src/bin/e_comp_wl.c

index 5a409aa..9f7076b 100644 (file)
@@ -1363,12 +1363,12 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
 
    if ((!need_send_motion) && (!need_send_released) && (ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED)) return;
 
-   if (!e_comp_wl->drag_client)
-     {
-        dev = ev->dev;
-        dev_name = evas_device_description_get(dev);
+   dev = ev->dev;
+   dev_name = evas_device_description_get(dev);
 
-        if (dev && (evas_device_class_get(dev) == EVAS_DEVICE_CLASS_TOUCH))
+   if (dev && (evas_device_class_get(dev) == EVAS_DEVICE_CLASS_TOUCH))
+     {
+        if (!e_comp_wl->drag_client)
           {
              e_comp_wl->touch.faked_ec = ec;
              if (e_comp_wl->touch.pressed & (1 << 0))
@@ -1379,27 +1379,31 @@ _e_comp_wl_evas_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
                                                   ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
                   _e_comp_wl_send_touch_move(ec, 0, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
                }
-
-             e_pointer_touch_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
           }
-        else
+
+        e_pointer_touch_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
+     }
+   else
+     {
+        if (!e_comp_wl->drag_client)
           {
              if (_e_comp_wl_check_cursor_timer_needed(ec))
                {
-                 if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_MOVE, ec))
-                   return;
+                  if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_MOVE, ec))
+                    return;
                }
 
              _e_comp_wl_device_send_event_device(ec, dev, ev->timestamp);
              _e_comp_wl_send_mouse_move(ec, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp);
 
-             e_pointer_mouse_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
              if (!need_send_released) // set cursor's hide_tmr only when mouse button is not pressed
                {
                   if (_e_comp_wl_check_cursor_timer_needed(ec))
                     _e_comp_wl_cursor_move_timer_control(ec);
                }
           }
+
+        e_pointer_mouse_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
      }
 }