termio: do not handle selection if it doesn't exist.

A typical case is when you try to force xdg-open on a media (instead
of inline) by pressing "Control". This would trigger single-click box
selection on mouse-down but on mouse up the mouse didn't move yet. By
processing this as selection one also leaves the "didclick ==
EINA_TRUE" from mouse-down, leading the link to not be processed
(_activate_link() wasn't called).

PS: what an awful name is "didclick".
This commit is contained in:
Gustavo Sverzut Barbieri 2013-11-01 17:11:10 -02:00
parent b50e64f80b
commit 1745503b89
1 changed files with 8 additions and 0 deletions

View File

@ -3078,6 +3078,14 @@ _smart_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED
if (sd->cur.makesel)
{
sd->cur.makesel = 0;
if ((sd->cur.sel1.x == sd->cur.sel2.x) &&
(sd->cur.sel2.y == sd->cur.sel2.y))
{
_sel_set(data, EINA_FALSE);
sd->didclick = EINA_FALSE;
}
if (sd->cur.sel)
{
sd->didclick = EINA_TRUE;