Page MenuHomePhabricator

efl/gesture: redo (and make stupider) hash usage in gesture manager
ClosedPublic

Authored by zmike on Jan 21 2020, 11:57 AM.

Details

Summary

this rewrites the gesture event dispatcher to use a hash of hashes for
tracking which events are being watched on a given object to avoid:

  • dispatching n gesture events per object to each callback, where n is the number of gesture callbacks for any given type
  • removing all gesture callbacks when only one callback is removed

this is not smart code. it should be improved at some time, but that time
is not now.

Depends on D11126

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.
zmike created this revision.Jan 21 2020, 11:57 AM
zmike updated this revision to Diff 28350.Jan 21 2020, 12:04 PM
zmike edited the summary of this revision. (Show Details)

I went full stupid and only needed like 70% stupid

I went full stupid and only needed like 70% stupid

I wonder if 70% stupid makes you less stupid or more intelligent? :P

Anyways, I liked the variable thisisreallystupid instantly.

CHAN requested changes to this revision.Jan 21 2020, 10:33 PM

@zmike Thank you.

Please explain more detail about this patch.

This revision now requires changes to proceed.Jan 21 2020, 10:33 PM
zmike added a comment.Jan 22 2020, 6:15 AM
In D11144#211181, @CHAN wrote:

@zmike Thank you.

Please explain more detail about this patch.

Which part can I help with? The goal is to resolve (in a hasty manner) the problems that the existing gesture callback hooks (e.g., _efl_canvas_gesture_manager_callback_add_hook()) have wherein having 2+ user callbacks added for a gesture on an object (as in D11145) will process the same input events 2+ times and break the recognizer. I tried to explain this in the commit log, but maybe I could have worded it more clearly somehow.

zmike updated this revision to Diff 28393.Jan 22 2020, 6:37 AM

remove off-canvas blocking

zmike updated this revision to Diff 28444.Jan 23 2020, 12:25 PM

rework/rebase

CHAN added a comment.Jan 28 2020, 2:44 AM

@zmike Thank you for the details.

I understand but if user register another widget's changed callback twice, for example spin_button, that callback will be called twice.

It doesn't seem to matter if the user registers the gesture callback more than once and recognizes it more than once.

zmike added a comment.Jan 28 2020, 6:34 AM

Hm that's an interesting point. In that case, I suppose I'd expect the events to be emitted n times, but the gesture recognizer must only be run 1 time per gesture. I can fix this.

zmike updated this revision to Diff 28583.Jan 28 2020, 6:49 AM

fix cb delete, also emit n cbs while having only 1 recognizer call

zmike updated this revision to Diff 28665.Jan 29 2020, 11:20 AM

rebase/rework

Ignore everything I said before, working on too little sleep.

CHAN added a comment.Jan 29 2020, 10:29 PM

@zmike do i have to see this commit more?

zmike added a comment.Jan 30 2020, 6:33 AM
In D11144#213538, @CHAN wrote:

@zmike do i have to see this commit more?

There shouldn't be an issue having all callbacks triggered? That's something handled by eo, not the gesture manager.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 5 2020, 1:13 AM
Closed by commit rEFLe41434d96da9: efl/gesture: redo (and make stupider) hash usage in gesture manager (authored by zmike, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain Why
This revision was automatically updated to reflect the committed changes.