entry - fix menu to not popup after every time mobile sel handles are clicked
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 6 Mar 2014 11:12:58 +0000 (20:12 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 6 Mar 2014 11:15:16 +0000 (20:15 +0900)
this fixes a behavior bug in entry @fix cherry-pick-me

src/lib/elm_entry.c

index ab4de25bf4fe735d5ddb31d61a7d126def99ed9a..c995522cb81d16b700919ab05d0bd767cb115398 100644 (file)
@@ -1622,7 +1622,6 @@ _mouse_down_cb(void *data,
          ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
          sd->longpress_timer = ecore_timer_add
            (_elm_config->longpress_timeout, _long_press_cb, data);
-         sd->long_pressed = EINA_FALSE;
       }
    else if (ev->button == 3)
      {
@@ -3072,6 +3071,8 @@ _start_handler_mouse_down_cb(void *data,
    sd->ox = ev->canvas.x - (ex + cx + (cw / 2));
    sd->oy = ev->canvas.y - (ey + cy + (ch / 2));
 
+   ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
+   sd->long_pressed = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      {
         _magnifier_create(data);
@@ -3091,7 +3092,7 @@ _start_handler_mouse_up_cb(void *data,
    sd->start_handler_down = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      _magnifier_hide(data);
-   if (!_elm_config->desktop_entry)
+   if ((!_elm_config->desktop_entry) && (sd->long_pressed))
      _menu_call(data);
 }
 
@@ -3123,6 +3124,8 @@ _start_handler_mouse_move_cb(void *data,
    edje_object_part_text_cursor_geometry_get(sd->entry_edje,
                                              "elm.text",
                                              &cx, &cy, NULL, &ch);
+   ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
+   sd->long_pressed = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      _magnifier_move(data, ex + cx, ey + cy + (ch / 2));
 }
@@ -3167,6 +3170,8 @@ _end_handler_mouse_down_cb(void *data,
    sd->ox = ev->canvas.x - (ex + cx + (cw / 2));
    sd->oy = ev->canvas.y - (ey + cy + (ch / 2));
 
+   ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
+   sd->long_pressed = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      {
         _magnifier_create(data);
@@ -3186,7 +3191,7 @@ _end_handler_mouse_up_cb(void *data,
    sd->end_handler_down = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      _magnifier_hide(data);
-   if (!_elm_config->desktop_entry)
+   if ((!_elm_config->desktop_entry) && (sd->long_pressed))
      _menu_call(data);
 }
 
@@ -3218,6 +3223,8 @@ _end_handler_mouse_move_cb(void *data,
    edje_object_part_text_cursor_geometry_get(sd->entry_edje,
                                              "elm.text",
                                              &cx, &cy, NULL, &ch);
+   ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
+   sd->long_pressed = EINA_FALSE;
    if (_elm_config->magnifier_enable)
      _magnifier_move(data, ex + cx, ey + cy + (ch / 2));
 }