Page MenuHomePhabricator

e_comp_wl: handle Evas_Device in Evas_Event_Mouse_XXX

Authored by Hermet on Apr 3 2016, 8:03 PM.



If (Evas_Device *)dev field is valid in Evas_Event_Mouse_XXX,
we can find out whether the exact source device is pointer or touch.
Then instead of emulating a mouse, we can send events of wl_touch.
This patch is related to Identification of input devices.

Test Plan
  1. User clicks on touch-screen. Enlightenment gets Evas_Event_Mouse_Down, not Evas_Event_Multi_Down.
  2. enlightenment checks if the class of source device.
  3. the application can gets wl_touch events, not wl_pointer.

Diff Detail

rE core/enlightenment
No Linters Available
No Unit Test Coverage
Build Status
Buildable 1839
Build 1904: arc lint + arc unit
ohduna updated this revision to Diff 8820.Apr 3 2016, 8:03 PM
ohduna retitled this revision from to e_comp_wl: handle Evas_Device in Evas_Event_Mouse_XXX.
ohduna updated this object.
ohduna edited the test plan for this revision. (Show Details)
ohduna added subscribers: input.hacker, JHyun, cedric.
zmike requested changes to this revision.Apr 4 2016, 9:19 AM
zmike edited edge metadata.
zmike added inline comments.

Should 0 be hardcoded here?


Do not forward initialize variables which are guaranteed to be initialized.

This revision now requires changes to proceed.Apr 4 2016, 9:19 AM
ohduna updated this revision to Diff 8833.Apr 4 2016, 10:50 PM
ohduna edited edge metadata.
ohduna marked 2 inline comments as done.

revised according to zmike's comment.

ohduna added inline comments.Apr 4 2016, 10:51 PM

Yes, it should.
Ecore_input_evas feeds Evas_Event_Mouse_XXX when multi.device value of Ecore_Event_Mouse_XXX is zero.
Otherwise, it feeds Evas_Event_Multi_XXX.
So, in case of Evas_Event_Mouse_XXX from a touh device, we can assume that the event came from first finger.

zmike added inline comments.Apr 5 2016, 12:15 PM

Can you add a comment about this to the code?

ManMower edited edge metadata.Apr 6 2016, 9:18 AM

I think I found a bug in the implementation...

start weston-simple-touch and place two fingers in the window. Lift the first finger while the second remains down.

Now, without lifting the second finger, hold down alt with your other hand and then add another finger to the window.

This will begin moving the window - I think it shouldn't?

Sorry for replying late, Derek.
As you can see, my implementation is very simple.
If event source of Evas_Event_Mouse_XXX is a touch device, we send down/up/motion events using wl_touch, not wl_pointer.

The weston-simple-touch client is like finger painting application.
It has only wl_touch listener, there are no wl_pointer listener. The first finger will draw red dots, and second finger will draw yellow dots.

Before this patch applies, the first finger CANNOT draw any dots since enlightenment send events using wl_pointer for first finger.

ohduna updated this revision to Diff 8960.Apr 19 2016, 11:46 PM
ohduna edited edge metadata.

add comments explaining why sending wl_touch events with "zero id"

ohduna marked 2 inline comments as done.Apr 19 2016, 11:48 PM

rebased this patch.

What I'm seeing is that lifting the first of two fingers and putting it back down while holding alt results in Enlightenment intercepting the new finger as a window move.

That finger should resume drawing in weston-simple-touch (as red dot, since it will once again be the "first" finger).

ohduna updated this revision to Diff 9023.May 3 2016, 12:59 AM

Thanks, ManMower.
I examined weston-simple-touch client as the way that you mentioned.
Mouse_Binding should work with mouse devices, not touch devices.
So I added check for mouse device when converting mouse event to e_binding_event_mouse_XXX.

Hermet commandeered this revision.Mar 27 2019, 6:36 PM
Hermet added a reviewer: ohduna.
This revision now requires changes to proceed.Mar 27 2019, 6:36 PM
Hermet abandoned this revision.Mar 27 2019, 6:36 PM

This is a too old patch, nobody keeps tracking on this anymore.