route all mouse movements to action_client during action grab

ensure client receives all necessary mouse events
This commit is contained in:
Mike Blumenkrantz 2017-06-16 14:59:42 -04:00
parent b48419c577
commit 5e7ca478d0
1 changed files with 11 additions and 0 deletions

View File

@ -754,11 +754,22 @@ _e_client_action_event_grabber_mouse_up(void *data EINA_UNUSED, Evas *e EINA_UNU
e_client_act_move_end(action_client, NULL);
}
static void
_e_client_action_event_grabber_mouse_move(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
{
Evas_Event_Mouse_Move *ev = event_info;
if (action_client &&
((ev->cur.output.x != action_client->mouse.current.mx) ||
(ev->cur.output.y != action_client->mouse.current.my)))
e_client_mouse_move(action_client, &ev->cur.output);
}
static void
_e_client_action_event_grabber_init(E_Client *ec)
{
action_rect = e_comp_canvas_event_grabber_add();
evas_object_event_callback_add(action_rect, EVAS_CALLBACK_MOUSE_UP, _e_client_action_event_grabber_mouse_up, NULL);
evas_object_event_callback_add(action_rect, EVAS_CALLBACK_MOUSE_MOVE, _e_client_action_event_grabber_mouse_move, NULL);
evas_object_smart_member_add(ec->frame, action_rect);
evas_object_resize(action_rect, e_comp->w, e_comp->h);
evas_object_layer_set(action_rect, EVAS_LAYER_MAX - 100);