diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-07-10 14:21:13 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-07-10 17:01:05 +0900 |
commit | 7f724f6c5db1127a6dd5786791f495b58910e9a9 (patch) | |
tree | 149248faeea2800c044c6bf4907e26b1a192d86f /src/lib/ecore_evas/ecore_evas.c | |
parent | 0d6cdd661c32247bb54b84031f3eeb6e19e9de8f (diff) |
evas: Fix mouse event info in global events
When using the legacy API (and in fact also with the EO API) to
listen to mouse events (move, in, out...) on a window instead
of an actual evas object, some information was missing:
- buttons (bitmask of pressed buttons)
- prev.x/y (previous position)
This is because Evas had not handled the event yet at this
point, it was coming directly from ecore_evas with incomplete
information. This patch involves evas a little bit earlier, and
also fixes evas_events_legacy.c to have consistent values for
cur/prev canvas/ouput coordinates. See also 890a91785 and
484dae76e675318. Those commits were making the pointer coord
a seat-based property (instead of canvas-based) but the event
should already have those proper values before converting to
a legacy struct. This patch restores the meaning of the DUP
macros, as I observed 4 different coordinates from the app side
(instead of just 2: prev and cur).
Thanks to Andy for reporting the original issue on the ML!
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_evas/ecore_evas.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index b6d82c55f9..280e82d609 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c | |||
@@ -3481,6 +3481,8 @@ _ecore_evas_mouse_move_process_internal(Ecore_Evas *ee, | |||
3481 | ev->timestamp = timestamp; | 3481 | ev->timestamp = timestamp; |
3482 | ev->cur.x = evt_x; | 3482 | ev->cur.x = evt_x; |
3483 | ev->cur.y = evt_y; | 3483 | ev->cur.y = evt_y; |
3484 | efl_input_pointer_finalize(evt); | ||
3485 | |||
3484 | efl_event_callback_legacy_call(ee->evas, | 3486 | efl_event_callback_legacy_call(ee->evas, |
3485 | _event_description_get(ev->action), evt); | 3487 | _event_description_get(ev->action), evt); |
3486 | efl_del(evt); | 3488 | efl_del(evt); |
@@ -4640,6 +4642,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P | |||
4640 | ev->angle = info->multi.angle - ee->rotation; | 4642 | ev->angle = info->multi.angle - ee->rotation; |
4641 | if (info->dev) ev->device = efl_ref(info->dev); | 4643 | if (info->dev) ev->device = efl_ref(info->dev); |
4642 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); | 4644 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); |
4645 | efl_input_pointer_finalize(evt); | ||
4643 | 4646 | ||
4644 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); | 4647 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); |
4645 | processed = ev->evas_done; | 4648 | processed = ev->evas_done; |
@@ -4701,6 +4704,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info) | |||
4701 | ev->angle = info->multi.angle - ee->rotation; | 4704 | ev->angle = info->multi.angle - ee->rotation; |
4702 | if (info->dev) ev->device = efl_ref(info->dev); | 4705 | if (info->dev) ev->device = efl_ref(info->dev); |
4703 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); | 4706 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); |
4707 | efl_input_pointer_finalize(evt); | ||
4704 | 4708 | ||
4705 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); | 4709 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); |
4706 | processed = ev->evas_done; | 4710 | processed = ev->evas_done; |
@@ -4735,6 +4739,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info) | |||
4735 | ev->wheel.dir = info->direction ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL; | 4739 | ev->wheel.dir = info->direction ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL; |
4736 | if (info->dev) ev->device = efl_ref(info->dev); | 4740 | if (info->dev) ev->device = efl_ref(info->dev); |
4737 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); | 4741 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); |
4742 | efl_input_pointer_finalize(evt); | ||
4738 | 4743 | ||
4739 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); | 4744 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); |
4740 | processed = ev->evas_done; | 4745 | processed = ev->evas_done; |
@@ -4764,6 +4769,7 @@ _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointe | |||
4764 | _pointer_position_set(ev, ee, info->x, info->y, info->x, info->y); | 4769 | _pointer_position_set(ev, ee, info->x, info->y, info->x, info->y); |
4765 | if (info->dev) ev->device = efl_ref(info->dev); | 4770 | if (info->dev) ev->device = efl_ref(info->dev); |
4766 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); | 4771 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); |
4772 | efl_input_pointer_finalize(evt); | ||
4767 | 4773 | ||
4768 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); | 4774 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); |
4769 | processed = ev->evas_done; | 4775 | processed = ev->evas_done; |
@@ -4893,6 +4899,7 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info) | |||
4893 | _pointer_position_set(ev, ee, x, y, x, y); | 4899 | _pointer_position_set(ev, ee, x, y, x, y); |
4894 | if (info->dev) ev->device = efl_ref(info->dev); | 4900 | if (info->dev) ev->device = efl_ref(info->dev); |
4895 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); | 4901 | else ev->device = efl_ref(evas_default_device_get(e, EFL_INPUT_DEVICE_TYPE_MOUSE)); |
4902 | efl_input_pointer_finalize(evt); | ||
4896 | 4903 | ||
4897 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); | 4904 | efl_event_callback_legacy_call(e, _event_description_get(ev->action), evt); |
4898 | processed = ev->evas_done; | 4905 | processed = ev->evas_done; |