e_client_transform_core_update(ec);
}
+EINTERN void
+e_comp_wl_map_inv_coord_get(E_Client *ec, int x, int y, int *mx, int *my)
+{
+ const Evas_Map *map;
+ Evas_Map *map2;
+ int map_c = 0, map_x = 0, map_y = 0;
+ double inv_x = 0.0, inv_y = 0.0;
+
+ EINA_SAFETY_ON_NULL_RETURN(ec);
+
+ map = evas_object_map_get(ec->frame);
+ map_c = evas_map_count_get(map);
+
+ if (!map || map_c <= 0)
+ {
+ *mx = x;
+ *my = y;
+ return;
+ }
+
+ map2 = evas_map_new(map_c);
+
+ evas_map_point_coord_set(map2, 0, ec->x, ec->y, 0);
+ evas_map_point_coord_set(map2, 1, ec->x + ec->w, ec->y, 0);
+ evas_map_point_coord_set(map2, 2, ec->x + ec->w, ec->y + ec->h, 0);
+ evas_map_point_coord_set(map2, 3, ec->x, ec->y + ec->h, 0);
+
+ for (int i = 0; i < map_c; i++)
+ {
+ evas_map_point_coord_get(map, i, &map_x, &map_y, NULL);
+ evas_map_point_image_uv_set(map2, i, map_x, map_y);
+ }
+ evas_map_coords_get(map2, (double)x, (double)y, &inv_x, &inv_y, 0);
+
+ *mx = (int)inv_x;
+ *my = (int)inv_y;
+
+ evas_map_free(map2);
+}
+
static void
_e_comp_wl_evas_cb_show(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
{
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);
}
+
+ pointer_x = ev->cur.output.x;
+ pointer_y = ev->cur.output.y;
+
+ if (evas_object_map_enable_get(ec->frame))
+ {
+ e_comp_wl_map_inv_coord_get(ec, pointer_x, pointer_y, &pointer_x, &pointer_y);
+ }
+
e_pointer_touch_move(e_comp->pointer, ev->cur.output.x, ev->cur.output.y);
}
else
pointer_x = ev->cur.output.x;
pointer_y = ev->cur.output.y;
- if (e_client_transform_core_enable_get(ec))
- e_client_transform_core_input_inv_rect_transform(ec, pointer_x, pointer_y, &pointer_x, &pointer_y);
+
+ if (evas_object_map_enable_get(ec->frame))
+ {
+ e_comp_wl_map_inv_coord_get(ec, pointer_x, pointer_y, &pointer_x, &pointer_y);
+ }
e_pointer_mouse_move(e_comp->pointer, pointer_x, pointer_y);
if (e_config->use_cursor_timer)
_e_comp_wl_device_renew_axis(dev_name, evas_device_class_get(dev),
ec, 0, ev->radius_x, ev->radius_y, ev->pressure, ev->angle);
_e_comp_wl_evas_handle_mouse_button_to_touch(ec, ev->timestamp, ev->canvas.x, ev->canvas.y, EINA_TRUE);
+
+ pointer_x = ev->output.x;
+ pointer_y = ev->output.y;
+
+ if (evas_object_map_enable_get(ec->frame))
+ {
+ e_comp_wl_map_inv_coord_get(ec, pointer_x, pointer_y, &pointer_x, &pointer_y);
+ }
+
e_pointer_touch_move(e_comp->pointer, ev->output.x, ev->output.y);
e_comp_wl->touch.pressed |= (1 << 0);
}
WL_POINTER_BUTTON_STATE_PRESSED);
pointer_x = ev->output.x;
pointer_y = ev->output.y;
- if (e_client_transform_core_enable_get(ec))
- e_client_transform_core_input_inv_rect_transform(ec, pointer_x, pointer_y, &pointer_x, &pointer_y);
+
+ if (evas_object_map_enable_get(ec->frame))
+ {
+ e_comp_wl_map_inv_coord_get(ec, pointer_x, pointer_y, &pointer_x, &pointer_y);
+ }
e_pointer_mouse_move(e_comp->pointer, pointer_x, pointer_y);
if (e_config->use_cursor_timer)
e_devicemgr_input_pointer_warp(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface, wl_fixed_t x, wl_fixed_t y)
{
E_Client *ec;
- int new_x, new_y;
- int ret;
+ Evas_Map *map;
+ int new_x, new_y, ret;
+ int i, min_x, min_y, max_x, max_y, tmp_x, tmp_y;
if (!(ec = wl_resource_get_user_data(surface)) || !ec->visible)
{
new_x = wl_fixed_to_int(x);
new_y = wl_fixed_to_int(y);
- if (e_client_transform_core_enable_get(ec))
- e_client_transform_core_input_inv_rect_transform(ec, wl_fixed_to_int(x), wl_fixed_to_int(y), &new_x, &new_y);
+
+ if (new_x < ec->x) new_x = ec->x;
+ if ((ec->w != 0) && (new_x > ec->x + ec->w - 1)) new_x = ec->x + ec->w - 1;
+
+ if (new_y < ec->y) new_y = ec->y;
+ if ((ec->h != 0) && (new_y > ec->y + ec->h - 1)) new_y = ec->y + ec->h - 1;
+
+ if (evas_object_map_enable_get(ec->frame))
+ {
+ e_comp_wl_map_inv_coord_get(ec, new_x, new_y, &new_x, &new_y);
+
+ map = (Evas_Map *)evas_object_map_get(ec->frame);
+ evas_map_point_coord_get(map, 0, &min_x, &min_y, NULL);
+ max_x = min_x;
+ max_y = min_y;
+
+ for (i = 1; i < evas_map_count_get(map); i++)
+ {
+ evas_map_point_coord_get(map, i, &tmp_x, &tmp_y, NULL);
+
+ if (tmp_x < min_x) min_x = tmp_x;
+ else if (tmp_x > max_x) max_x = tmp_x;
+
+ if (tmp_y < min_y) min_y = tmp_y;
+ else if (tmp_y > max_y) max_y = tmp_y;
+ }
+
+ if (min_x != max_x)
+ {
+ if (new_x < min_x) new_x = min_x;
+ if (new_x > max_x - 1) new_x = max_x - 1;
+ }
+ if (min_y != max_y)
+ {
+ if (new_y < min_y) new_y = min_y;
+ if (new_y > max_y - 1) new_y = max_y - 1;
+ }
+ }
ret = _e_devicemgr_input_pointer_warp(ec->client.x + new_x, ec->client.y + new_y);
return ret;