[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [E-devel] [Evas] double click issues
On Fri, 25 Aug 2006 11:13:08 +0200,
Simon TRENY <firstname.lastname@example.org> wrote :
> Hey there,
> I've got some problems with the "flags" member of the "mouse down"
> events of Evas. Sometimes those flags are not set correctly.
> - First example, I have a smart object (an Edje object in this case).
> When I click on a part ("part1") of the Edje object, an other part
> ("part2") is shown and covers up "part1". So now, "part2" receives the
> mouse events. Now, if I double-click on "part1", on the first click
> "part2" will appear, and the second click will be then received by
> "part2", and be detected as a single-click (which is normal since it's
> the first click "part2" has received). But when the click event is
> propagated to the smart parent (in this case, the edje object), the
> mouse flags won't be changed and the edje object will receive a
> single-click event while the user has double-clicked on it. So there
> is no way to double-click an edje object like this (that's why the
> icons can't be double-clicked in the iconbox of Etk). (I've attached
> a small program that shows that)
I've fixed that by recalculating the "flags" member of the event
structure each time the event is propagated to the smart parent of the
object. So this code:
if (ev->flags & (EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK))
if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1))
ev->flags &= ~(EVAS_BUTTON_DOUBLE_CLICK | EVAS_BUTTON_TRIPLE_CLICK);
has been moved from evas_event_feed_mouse_down/up() to
evas_object_event_callback_call() since the propagation of the event is
done in evas_object_event_callback_call(). This may seem more dirty but
this is the only way I've found to do it (raster, could you look at the
code of evas_object_event_callback_call() in etk_callbacks.c, and tell
me if you think this is the right place to do that?)
> Another problem I forgot to mention previously. The "flags" member of
> the "mouse up" events are always set to EVAS_BUTTON_NONE. So there is
> no way to detect a double/triple-click when the mouse is released.
This has also been fixed. Ecore_X now detects double/triple clicks on
mouse-up and those flags are feeded to Evas.
> - Second problem, when you double-click in the entry of e17, all the
> text is selected. Now, if you click to move the cursor at the mouse
> position, and then click at another point of the entry to move the
> cursor again, if you do that quickly, the second click will be
> detected as a double-click and all the text will be selected.
This is the only remaining problem. Actually, the question is: should a
quick "click-move-click" sequence be detected as a double click or not?
If it should not, I think we should still add a threshold (4 or 5
pixels) so the mouse could move a bit between the two clicks, and the
event would still be detected as a double-click. This would be useful
with laptop's touchpad, digital pen, or other inaccurate pointing
devices (or inaccurate users :). And if we do that, should it be
implemented in Ecore_X or in Evas itself?
> Simon TRENY