static Eina_Bool
_e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev)
{
- int ec_x, ec_y;
-
e_comp_wl->ptr.x = wl_fixed_from_int(ev->x);
e_comp_wl->ptr.y = wl_fixed_from_int(ev->y);
- if (e_comp_wl->selection.target &&
- e_comp_wl->drag)
- {
- struct wl_resource *res;
- int x, y;
- E_Client *ec = NULL;
- E_Client *legacy_target = e_comp_wl->selection.target;
- int device_id = e_comp_wl_data_current_device_id_get();
-
- if (device_id < 0)
- {
- e_comp_wl_data_current_device_id_set(ev->multi.device);
- }
- else if (device_id != ev->multi.device)
- {
- return ECORE_CALLBACK_RENEW;
- }
-
- ec = e_client_under_position_input_get(legacy_target->desk, ev->x, ev->y);
- EINA_SAFETY_ON_NULL_RETURN_VAL(ec, ECORE_CALLBACK_RENEW);
-
- struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
- EINA_SAFETY_ON_NULL_RETURN_VAL(surface, ECORE_CALLBACK_RENEW);
-
- res = e_comp_wl_data_find_for_client(wl_resource_get_client(surface));
- EINA_SAFETY_ON_NULL_RETURN_VAL(res, ECORE_CALLBACK_RENEW);
-
- if ((e_comp_wl->drag_offer != wl_resource_get_user_data(res)) &&
- (ec != legacy_target))
- {
- e_comp_wl_data_device_send_leave(legacy_target);
- e_comp_wl_data_device_send_enter(ec);
- }
-
- if (e_comp_wl->drag)
- e_drag_move(e_comp_wl->drag, ev->x, ev->y);
-
- if (e_client_transform_core_enable_get(ec))
- {
- int trans_x, trans_y;
- e_client_transform_core_input_transform(ec, ev->x, ev->y, &trans_x, &trans_y);
- x = trans_x - ec->client.x;
- y = trans_y - ec->client.y;
- }
- else
- {
- e_client_geometry_get(ec, &ec_x, &ec_y, NULL, NULL);
- x = ev->x - ec_x;
- y = ev->y - ec_y;
- }
-
- wl_data_device_send_motion(res, ev->timestamp, wl_fixed_from_int(x), wl_fixed_from_int(y));
- }
-
return ECORE_CALLBACK_RENEW;
}