summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-08-29 18:26:46 +0200
committerBoris Faure <billiob@gmail.com>2013-08-29 18:26:46 +0200
commite710205122fb9a8b0e74064a2bb28ef986418039 (patch)
treeba20f2b451342cfa77172b92fb5c6004fa271f51
parentd746dccf4a657e2b588511ed514531362a18a6c0 (diff)
try to fix some link/selection mess
-rw-r--r--src/bin/termio.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index b3b35fb..329aa1c 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -318,20 +318,21 @@ _cb_link_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
318{ 318{
319 Evas_Event_Mouse_Up *ev = event; 319 Evas_Event_Mouse_Up *ev = event;
320 Termio *sd = evas_object_smart_data_get(data); 320 Termio *sd = evas_object_smart_data_get(data);
321 Evas_Coord dx, dy;
322
323 if (!sd) return; 321 if (!sd) return;
324 dx = abs(ev->canvas.x - sd->link.down.x); 322
325 dy = abs(ev->canvas.y - sd->link.down.y);
326 if ((ev->button == 1) && (sd->link.down.down) &&
327 ((dx <= elm_config_finger_size_get()) &&
328 (dy <= elm_config_finger_size_get())))
329 {
330 if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer);
331 sd->link_do_timer = ecore_timer_add(0.2, _cb_link_up_delay, data);
332 }
333 if ((ev->button == 1) && (sd->link.down.down)) 323 if ((ev->button == 1) && (sd->link.down.down))
334 { 324 {
325 Evas_Coord dx, dy, finger_size;
326
327 dx = abs(ev->canvas.x - sd->link.down.x);
328 dy = abs(ev->canvas.y - sd->link.down.y);
329 finger_size = elm_config_finger_size_get();
330
331 if ((dx <= finger_size) && (dy <= finger_size))
332 {
333 if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer);
334 sd->link_do_timer = ecore_timer_add(0.2, _cb_link_up_delay, data);
335 }
335 sd->link.down.down = EINA_FALSE; 336 sd->link.down.down = EINA_FALSE;
336 } 337 }
337} 338}
@@ -3137,7 +3138,8 @@ _smart_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS
3137} 3138}
3138 3139
3139static void 3140static void
3140_smart_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) 3141_smart_cb_mouse_in(void *data, Evas *e EINA_UNUSED,
3142 Evas_Object *obj EINA_UNUSED, void *event)
3141{ 3143{
3142 int cx, cy; 3144 int cx, cy;
3143 Evas_Event_Mouse_In *ev = event; 3145 Evas_Event_Mouse_In *ev = event;
@@ -3152,17 +3154,30 @@ _smart_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED
3152 3154
3153static void 3155static void
3154_smart_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, 3156_smart_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
3155 void *event EINA_UNUSED) 3157 void *event)
3156{ 3158{
3157 Termio *sd; 3159 Termio *sd;
3160 Evas_Event_Mouse_Out *ev = event;
3158 3161
3159 sd = evas_object_smart_data_get(data); 3162 sd = evas_object_smart_data_get(data);
3160 if (!sd) return; 3163 if (!sd) return;
3161 termio_mouseover_suspend_pushpop(data, 1); 3164 termio_mouseover_suspend_pushpop(data, 1);
3162 ty_dbus_link_hide(); 3165 ty_dbus_link_hide();
3163 sd->mouse.cx = -1; 3166 if ((ev->canvas.x == 0) || (ev->canvas.y == 0))
3164 sd->mouse.cy = -1; 3167 {
3165 _remove_links(sd, obj); 3168 sd->mouse.cx = -1;
3169 sd->mouse.cy = -1;
3170 sd->link.suspend = EINA_FALSE;
3171 _remove_links(sd, obj);
3172 }
3173 else
3174 {
3175 int cx, cy;
3176
3177 _smart_xy_to_cursor(data, ev->canvas.x, ev->canvas.y, &cx, &cy);
3178 sd->mouse.cx = cx;
3179 sd->mouse.cy = cy;
3180 }
3166} 3181}
3167 3182
3168static void 3183static void