Page MenuHomePhabricator

evas: fix logic in evas_events.c
ClosedPublic

Authored by eunue on Apr 26 2017, 12:10 AM.

Details

Summary

when collecting the objects under a mouse pointer,
evas uses the geometry of an object to decide
whether the mouse pointer is inside the area of the object,
which is inappropriate for a mapped object.
so mapped objects don't receive mouse events when they should.
this patch fixes the issue.

Test Plan

A sample code will be added as comments

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
eunue created this revision.Apr 26 2017, 12:10 AM
eunue added a comment.EditedApr 26 2017, 12:12 AM

#include <Elementary.h>

static void
_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{

printf("MOUSE DOWN!\n");
fflush(stdout);

}

EAPI_MAIN int
elm_main(int argc, char **argv)
{

Evas_Object *win, *rect;
Evas_Map *map;
int w, h, offset_x, offset_y;

w = 200;
h = 200;
offset_x = 100;
offset_y = 100;

win = elm_win_util_standard_add("test", "Test");
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_win_autodel_set(win, EINA_TRUE);
evas_object_resize(win, 500, 500);
evas_object_show(win);

rect = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(rect, 255, 0, 0, 255);
evas_object_resize(rect, w, h);
evas_object_show(rect);
evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _down_cb, NULL);

map = evas_map_new(4);
evas_map_util_points_populate_from_object(map, rect);

evas_map_point_image_uv_set(map, 0, 0, 0);
evas_map_point_image_uv_set(map, 1, w, 0);
evas_map_point_image_uv_set(map, 2, w, h);
evas_map_point_image_uv_set(map, 3, 0, h);

evas_map_point_coord_set(map, 0, 0 + offset_x, 0 + offset_y, 0);
evas_map_point_coord_set(map, 1, w + offset_x, 0 + offset_y, 0);
evas_map_point_coord_set(map, 2, w + offset_x, h + offset_y, 0);
evas_map_point_coord_set(map, 3, 0 + offset_x, h + offset_y, 0);

evas_object_map_set(rect, map);
evas_object_map_enable_set(rect, EINA_TRUE);

evas_map_free(map);

elm_run();

return 0;

}
ELM_MAIN();

jpeg accepted this revision.Apr 26 2017, 1:34 AM

you can push this

This revision is now accepted and ready to land.Apr 26 2017, 1:34 AM
raster accepted this revision.Apr 26 2017, 2:42 AM
This revision was automatically updated to reflect the committed changes.