From f56a228e701eddf04f1bceba052cec83d5cd85c8 Mon Sep 17 00:00:00 2001 From: Stephen Houston Date: Wed, 24 Oct 2018 15:19:47 -0500 Subject: [PATCH] Gadget Menu: Cancel menu after a drag *EITHER* vertically or horizontally, not *BOTH*. Fixes longpress menu interrupting drag in gadgets such as pager. The longpress menu was only getting cancelled if a drag occured at a distance of least 25 pixels. This is due to the code checking for horizontal drag distance + vertical drag distance >= 25. I believe the intent here was to cancel drag if >= 5 vertically or >= 5 horizontally, not both. Most drags wouldn't be 25 pixels in a single gadget such as pager, and a 25 pixel drag would not happen quick enough to offset longpress. This commit also lowers the drag cancelling threshold to 3 pixels, not 5. --- src/bin/e_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c index e28e066f6..5e2325d04 100644 --- a/src/bin/e_gadget.c +++ b/src/bin/e_gadget.c @@ -1488,7 +1488,7 @@ _site_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, dx = ev->cur.canvas.x - zgs->down_1_x; dy = ev->cur.canvas.y - zgs->down_1_y; - if (((dx * dx) + (dy * dy)) >= (5 * 5)) + if (((dx * dx) >= 3) || ((dy * dy) >= 3)) { E_FREE_FUNC(zgs->down_timer, ecore_timer_del); }