Commit Graph

167 Commits

Author SHA1 Message Date
Hosang Kim 425c98289d evas_events: add checking state of point
Summary:
When multi down or multi move occur, state of touch point changes to EVAS_TOUCH_POINT_STILL.
So I add condition, "state == EVAS_TOUCH_POINT_STILL"

Reviewers: jypark, woohyun, cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5157
2017-09-19 17:22:48 +09:00
jiin.moon 4f8fe4889f evas_event: Fix missing case when check the event area
Summary:
If the object is outside the parent geometry because of map,
this object would be ignored in determining object is in the event area.

Please refer to below case
1) There are some button in the box object
2) A button has map with 90 degree.
   It would be placed outside the box geometry
3) If you press the button part outside the box,
   the button event does not work.

Test Plan: sample code

Reviewers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D5180
2017-09-19 16:59:16 +09:00
Jean-Philippe Andre 0c46fc7103 evas: Use Eina_Rectangle internally
Instead of Evas_Coord_Rectangle which is exactly the same thing but with
a different name and typedefs.
2017-09-13 18:03:34 +09:00
Jean-Philippe Andre d4b4ee867b evas: Modify wheel events direction to bool (EO)
The orientation was overkill here. We only want a bool.

Ref T5870
2017-08-10 14:42:08 +09:00
Carsten Haitzler 302731e1af evas events - remove set of list to null then back to value - confusing
eina_list_free always returns NULL. it's meant as a design pattern to
follow like the append/prepend that ensures a freed list is NULL, but
it can be confusing to analysers so remove the assing. not a bug
actually.

found by PVS studio
2017-07-29 09:08:40 +09:00
Carsten Haitzler ea7dd2a9c2 evas mouse in/out/move event fix to remove "invalid move"
this should fix T5582 "properly" by emitting a move after an in only
if pointer x,y changed. this fixes rage and i hope still should handle
the original issue. let me know if it doesn't.

@fix
2017-07-12 15:45:47 +09:00
Jean-Philippe Andre dc9ebdd706 evas: Always send mouse,move after mouse,in to objects
Fixes T5582
2017-06-16 12:49:33 -04:00
Mike Blumenkrantz e3126bd23f evas: create dummy seat data for wl/drm outputs, store some pointer data
with async device init, it's possible for mouse in/out/move events to be added
by an application before the pointer devices are created. these are independent
of devices, so store the state and apply when pointer devices are added

fix T5531
2017-06-16 12:23:08 -04:00
Mike Blumenkrantz 8dd12d2cfa evas: redo Evas_Pointer_Data/Seat to be inlist-based
simplify many internal lookups of pointer data and make hierarchy reflect
logical device hierarchy
2017-06-16 12:23:07 -04:00
Mike Blumenkrantz deb18460c4 evas: unify more complex conditional clauses in evas_events.c
no functional changes
2017-06-16 12:23:07 -04:00
Mike Blumenkrantz 6178b2a9d6 evas: unify complex repeated conditional clauses in evas_events.c
this code is unreadable

no functional changes
2017-06-16 12:23:07 -04:00
Jean-Philippe Andre a1141d8378 evas: Fix compilation with DDD_DO
This enables some insane debugging for input events inside evas.
Also, declutter the code by always providing the "spaces" variable.
Obviously this is not enabled :)
2017-06-15 20:28:24 +09:00
Cedric BAIL 0516cdc0f9 evas: use Eina_List instead of Eina_CList for event grabber.
Eina_Clist can actually change the pointer in the cell next bypassing
the CoW infrastructure leading to trouble. Considering the case here,
using the optimization of Eina_Clist is not necessary and if performance
issue arise, can be fixed by using a dichotomic search when removing
data. I don't think it is necessary to add this complexity without
a real life case.
2017-06-14 12:45:26 -07:00
Cedric BAIL b312729109 evas: allow list for _evas_event_object_list_in_get utility function. 2017-06-14 12:45:26 -07:00
Cedric BAIL cbfad5760d Revert "Revert "evas: put events related pointer into a cow to reduce evas_object fat.""
This reverts commit f9d3219c17.
2017-06-14 09:36:22 -07:00
Carsten Haitzler f9d3219c17 Revert "evas: put events related pointer into a cow to reduce evas_object fat."
This reverts commit f69686ba40.

this causes major crashes in e every time you move and resize a
window. i cant even debug it properly because i cant move or resize
windows to get terminals up to debug it... this is bad... so until a
fix is found better to go back to working...
2017-06-13 11:08:55 +09:00
Cedric Bail f69686ba40 evas: put events related pointer into a cow to reduce evas_object fat. 2017-06-12 11:41:25 -07:00
Jean-Philippe Andre 83d18617b4 evas: Remove device "parent", "name" and "description" properties
Those are now merged with Efl.Object parent, name and comment.
The reasoning is that only seats can be parent devices; And name
and description are not only name clashes but also not extremely
useful anyway.

Tested with VNC.

Fixes T5540
2017-06-12 15:17:50 +09:00
Mike Blumenkrantz 7fafbdee28 evas: add new event_grabber smart-ish object
adding an "event rect" is a common use case for rectangles, but I needed
a smarter event rect so I sent one off to school and it came back like this.

an event_grabber is a smart object which functions like a normal event rect
which has color(0,0,0,0), but with an important difference: it can have smart
members. event propagation works differently for an event_grabber:

normal:
	event -> layer -> smart(obj1,obj2,obj3) ->(?) other objects
in this case, obj1,obj2,obj3 are all "inside" the smart object and their stacking
will always be considered as being inside the smart object. rendering is also
tied to the smart object in this case, as is clipping.
an event which reaches a smart object will be sent to the objects inside,
and then may continue through the smart object if there are no objects which
block repeating.

event_grabber:
	event -> layer -> event_grabber -> obj1,obj2,obj3 -> STOP
in this case, obj1,obj2,obj3 are unmodified after being added to the event_grabber
and can be stacked, rendered, and clipped completely independently of the
event_grabber.
the event_grabber is considered an "event_parent" for this case. member objects
are not "inside" the event_grabber, and they are unable to receive events on
their own. instead, the event_grabber, which must be stacked above all its
members, receives events and propagates them top->down through its member objects.
if none of the member objects block the repeat of an event then the event will
still be blocked from further propagation past the event_grabber.

object lifetimes are independent of the event_grabber; deleting the event_grabber
has no effect on its members.

@feature
2017-06-09 20:06:19 -04:00
Mike Blumenkrantz dd42f8f291 evas: remove null check, passthrough list in _evas_event_object_list_in_get()
_evas_event_object_list_raw_in_get() already has a null check and uses the
last list member

no functional changes
2017-06-09 19:14:59 -04:00
Mike Blumenkrantz 9b9313882c evas: split _evas_event_object_list_raw_in_get() into two functions
slightly outdent code and prepare for pending features

no functional changes
2017-06-09 19:14:59 -04:00
Mike Blumenkrantz 32bf71f19e evas: simplify seat-getting during key event dispatch 2017-06-02 18:23:42 -04:00
Mike Blumenkrantz 890a917852 evas: redo pointer data to be per-seat instead of per-device
pointer devices are grouped into seats, and it is the seat which has
states related to canvas coordinates

@fix

ref 484dae76e6
2017-06-02 18:23:42 -04:00
Jean-Philippe Andre eb27724eb9 evas: Set modifiers & locks on global key events
Fixes T5510
2017-05-30 19:16:48 +09:00
Cedric BAIL 4baeb17dba evas: adjust pointer mode set to work in headless scenario.
With the wayland backend, it is posible to have no seat connected
until later. This would lead to calling evas_object_pointer_mode_set
and fail without returning a boolean it was impossible to detect it
did fail. This patch correct it.
2017-05-09 15:54:45 -07:00
Jaeun Choi afbe8ade6b evas: fix logic in evas_events.c
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

Reviewers: jpeg, raster

Subscribers: cedric, eunue

Differential Revision: https://phab.enlightenment.org/D4826
2017-04-26 18:42:49 +09:00
Bruno Dilly e0170c2b0d evas_events: look for seats on hash instead of input devices
Summary:
Otherwise it won't ever find the modifier masks.

Fixes T5146

@fix

Reviewers: iscaro, Jaehyun_Cho

Subscribers: cedric, jpeg

Maniphest Tasks: T5146

Differential Revision: https://phab.enlightenment.org/D4738
2017-03-24 14:14:38 -03:00
Jean-Philippe Andre 99d21f6d9c evas: Print CRI message in case of bad event usage
This will abort E when using Bryce and EINA_LOG_ABORT is enabled
(it is enabled by default when running a non-release version of E).
That's on purpose, as that code needs fixing :)

Ref T3144
2017-03-08 17:04:57 +09:00
Jean-Philippe Andre 0d555dda7f evas: Optimize out some calls to data_scope_get
Within evas when we know an object is marked as is_smart, then
we know it's a smart object. :)

@optimize
2017-02-21 10:52:40 +09:00
Jean-Philippe Andre 54e5841b2f evas: Re-fix post-event cb by supporting recursion
The previous patch (b184874fa5) was preventing
post-event callbacks from triggering any form of input event,
including side-effects due to mouse,in. In fact by tracking
which exact events we want to post-process we can support
proper recursion. This fixes crashes in Bryce.

I'm not changing the documentation as this is still a dubious
code design.

Fixes T3144
Fixes T5157
2017-02-16 19:51:06 +09:00
Jean-Philippe Andre b184874fa5 evas: Strengthen post-event callbacks
See T3144 that I marked as Wontfix.

Bryce in E manually feeds events from a post-event callback
resulting in Evas going insane and leading to frequent crashes.
The ideal solution (for E) would be to ensure that everything works
smoothly, the input event data is valid up until the post-event cb
is called, etc... Unfortunately, with recursive events the exact
order of operations may be messed up: the post-event

I don't want to add yet more complexity to Evas events here (it's
already spaghetti all over the place) so I'm simply blocking any
new event feed when running the post-event callback list.

It's not possible to just freeze the events (I tried, it failed).

**********************
Some more explanation:

post-event callbacks are used to implement reverse-order logic
where the on-hold flag of an input event may be set by an event
listener that does not come first.

Here's a situation to illustrate: scroller A inside scroller B.

As events are propagated from children to parents (assuming the
propagate flag is set), we'd assume the events to go first to A
and then to B, which means a mouse wheel event would make the
inner-most scroller (A) scroll, and the outer-most scroller (B)
wouldn't budge.

But as things are designed, A and B are not simple evas objects,
and the actual event-catching object is a top-most transparent
rectangle (top-most in Z stack order). Since A is inside B, B's
rectangle BR is over A's rectangle AR, thus catches the wheel
event first. But in terms of UX we still want A to scroll, not B.

The solution then is to reverse the event processing order and
post-event callbacks are the way to do that. This comes with the
consequence that the event_info needs to remain valid until the
post-event is called, and stay the same (so that the on-hold flag
set by A can be read by B).

Recursive events (by explicit feed or modifying the canvas so
that mouse,in or mouse,out are triggered) mess with this logic,
and trigger the post-events too early (event is not fully
processed) or too late (event_info is not valid anymore... and
crash!).

Thanks @raster for explaining the goal of post-event callbacks!
2017-02-16 18:10:18 +09:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Hosang Kim fc05adbb47 evas_events: add checking NULL logic to source mouse event.
Summary:
When the proxy's source is updated, the proxy's event list will be
updated, too. But there is no way now. So add defensive code for
protecting segment fault.

@fix

Reviewers: woohyun, raster, jpeg

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4508
2017-01-02 15:17:40 +09:00
Chris Michael 1b9aa3f995 evas: remove float comparison warnings for evas_events
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 10:25:36 -05:00
Guilherme Iscaro f153d4ce0f Efl.Canvas.Object: Remove the extra parementer at _evas_object_pointer_data_get()
The Evas_Pointer_Data struct already contains a Efl.Input.Device pointer.
2016-12-13 03:28:31 -02:00
Stefan Schmidt 5e06cd7daf evas: events: fix NULL check on returned value
Continuing the loop if the returned pdata is non-NULL does not make sense.
What Coverity actually found was that if we have cobj_pdata NULL here we
would happily deref it the line afterwards and crash.

Guilherme, Bruno if something else was intended here feel free to change it
again.

CID: 1366822
2016-12-06 11:05:40 +01:00
Carsten Haitzler 9e8257367d evas - fix out events broken by recent multiseat work
this fixes e's poitners to be "sensible" again.
2016-12-03 14:46:21 +09:00
Guilherme Iscaro c3ed1d3154 Evas: Add support for per seat modifiers and locks.
This patch introduces possibility to enable key locks and modifers by seat.
It's very useful when the user has two keyboards attached to different seats.
2016-12-02 09:57:50 -02:00
Guilherme Iscaro 484dae76e6 Evas: Add support for per mouse pointer mode/properties.
This patch introduces the possibility to set the pointer mode and
query other properties like current position per pointer device.
The old API will still works, however it will only act on the default seat.
2016-12-02 09:57:50 -02:00
Guilherme Iscaro c5f14a61e3 Evas: Add per seat Evas focus state. 2016-11-28 13:57:55 -02:00
Guilherme Iscaro fd6f6c14c1 Evas: Use events to set canvas focus in/out. 2016-11-24 19:18:47 -02:00
Guilherme Iscaro ded24d80ed Evas: Use events to flag canvas focus in/out. 2016-11-24 19:18:47 -02:00
Jean-Philippe Andre aac8f6f114 evas: Add function on object to check is pointer is in
This fixes invalid mouse cursor used when windows are
created.

Due to the changes in the border theme and the fact that
a border is now always created, the event region
"elm.resize.bl" contains the point (0,0) when the window
size itself is 1x1. As a consequence every EFL application
would permanently have a cursor like the resize bottom/left
handle.

This fixes that by properly checking whether the pointer is
inside an object based on the ins list, and not just the
object geometry.

@feature

See also: b735386a45
2016-11-23 13:04:12 +09:00
Guilherme Iscaro 0e53b9a8ac Evas: Add support for multiple focused objects.
Using the multi-seat support, Evas is able to handle multiple focused objects.
This implementation allows one focused object per seat.
This patch introduces new APIs and events to handle this new scenario,
while keeping compatible with the old focus APIs.
2016-11-08 17:54:34 -02:00
Guilherme Iscaro add589c1b4 Evas: Properly set the device under legacy events.
If the user did an evas_device_push(), the event will contain the
pushed device, otherwise use the default devices.
2016-11-08 17:54:34 -02:00
Guilherme Iscaro fd4f17f315 Evas Events: Properly ref the Efl_Input_Devices. 2016-11-08 17:54:34 -02:00
Jean-Philippe Andre 0c850f67ce evas: Fix previous pointer position in output coords
This fixes the test "Window Socket" map resize.
I broke that in 40fec5f608

Makes me wonder if the previous position should be exposed
in EO as well.
2016-11-08 14:15:14 +09:00
Chris Michael 0f8fb7ef88 evas: Fix jpeg snafu and properly send hold events to children
Commit 405680e836 changed how hold
events were being sent. Previous code was sending the hold events to
child objects, however after mentioned commit, they were being sent to
main objects. This patch fixes that.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-08 08:40:16 -04:00
Chris Michael c3d5ccf0f9 Revert "evas: Remove set but not used variable"
This reverts commit 24c5df29b3.

This should not have been pushed. Removed the variable from the wrong
spot :(
2016-09-07 08:35:30 -04:00
Chris Michael 24c5df29b3 evas: Remove set but not used variable
Gcc warns eo_child is set but not used here, so remove it.

NB: This should have been removed in previous evas_events commit. Oopise

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-07 08:31:39 -04:00