discomfitor pushed a commit to branch master.

commit db72a84e5822d27717975f992801d81a89d929f5
Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Apr 25 11:45:53 2013 +0100

    improve efm mouse move detection (no more tooltips when cursor is in 
separate window)
---
 ChangeLog      |  1 +
 NEWS           |  1 +
 src/bin/e_fm.c | 56 ++++++++++++++++++++++++++++++++++++--------------------
 3 files changed, 38 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc6af85..1b54642 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2013-04-25 Mike Blumenkrantz
 
         * added deskmirror
+        * improve efm mouse movement detection for icons
 
 2013-04-19 Mike Blumenkrantz
 
diff --git a/NEWS b/NEWS
index fa51040..69c0f72 100644
--- a/NEWS
+++ b/NEWS
@@ -134,6 +134,7 @@ Improvements:
     * desk flip animations moved to edje
     * startup splash screen moved to compositor canvas
     * added new modes for notification display on multiple monitors
+    * improve efm mouse movement detection for icons
 
 Fixes:
     * IBar menu didn't allow to configure different icon sources, show 
contents menu even on empty IBar.
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index cd339e1..16a643d 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -183,7 +183,7 @@ struct _E_Fm2_Icon
    E_Fm2_Smart_Data *sd;
    E_Fm2_Region     *region;
    Evas_Coord        x, y, w, h, min_w, min_h;
-   Evas_Object      *obj, *obj_icon;
+   Evas_Object      *obj, *obj_icon, *rect;
    E_Menu           *menu;
    E_Entry_Dialog   *entry_dialog;
    Evas_Object      *entry_widget;
@@ -4783,13 +4783,20 @@ _e_fm2_icon_label_click(void *data, Evas_Object *obj 
__UNUSED__, const char *emi
 static void
 _e_fm2_icon_realize(E_Fm2_Icon *ic)
 {
+   Evas *e;
+
    if (ic->realized) return;
+   e = evas_object_evas_get(ic->sd->obj);
    /* actually create evas objects etc. */
    ic->realized = EINA_TRUE;
-   evas_event_freeze(evas_object_evas_get(ic->sd->obj));
-   ic->obj = edje_object_add(evas_object_evas_get(ic->sd->obj));
+   evas_event_freeze(e);
+   ic->obj = edje_object_add(e);
    edje_object_freeze(ic->obj);
    evas_object_smart_member_add(ic->obj, ic->sd->obj);
+   ic->rect = evas_object_rectangle_add(e);
+   evas_object_color_set(ic->rect, 0, 0, 0, 0);
+   evas_object_smart_member_add(ic->rect, ic->sd->obj);
+   evas_object_repeat_events_set(ic->rect, 1);
    evas_object_stack_below(ic->obj, ic->sd->drop);
    if (_e_fm2_view_mode_get(ic->sd) == E_FM2_VIEW_MODE_LIST)
      {
@@ -4836,25 +4843,31 @@ _e_fm2_icon_realize(E_Fm2_Icon *ic)
                                        "base/theme/fileman",
                                        "icon/variable");
      }
+   evas_object_stack_above(ic->rect, ic->obj);
    _e_fm2_icon_label_set(ic, ic->obj);
    evas_object_clip_set(ic->obj, ic->sd->clip);
    evas_object_move(ic->obj,
                     ic->sd->x + ic->x - ic->sd->pos.x,
                     ic->sd->y + ic->y - ic->sd->pos.y);
+   evas_object_move(ic->rect,
+                    ic->sd->x + ic->x - ic->sd->pos.x,
+                    ic->sd->y + ic->y - ic->sd->pos.y);
    evas_object_resize(ic->obj, ic->w, ic->h);
+   evas_object_resize(ic->rect, ic->w, ic->h);
 
-   evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_DOWN, 
_e_fm2_cb_icon_mouse_down, ic);
-   evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_UP, 
_e_fm2_cb_icon_mouse_up, ic);
-   evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_MOVE, 
_e_fm2_cb_icon_mouse_move, ic);
-   evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_IN, 
_e_fm2_cb_icon_mouse_in, ic);
-   evas_object_event_callback_add(ic->obj, EVAS_CALLBACK_MOUSE_OUT, 
_e_fm2_cb_icon_mouse_out, ic);
+   evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_DOWN, 
_e_fm2_cb_icon_mouse_down, ic);
+   evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_UP, 
_e_fm2_cb_icon_mouse_up, ic);
+   evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_MOVE, 
_e_fm2_cb_icon_mouse_move, ic);
+   evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_IN, 
_e_fm2_cb_icon_mouse_in, ic);
+   evas_object_event_callback_add(ic->rect, EVAS_CALLBACK_MOUSE_OUT, 
_e_fm2_cb_icon_mouse_out, ic);
    edje_object_signal_callback_add(ic->obj, "e,action,label,click", "e", 
_e_fm2_icon_label_click, ic);
 
    _e_fm2_icon_icon_set(ic);
 
    edje_object_thaw(ic->obj);
-   evas_event_thaw(evas_object_evas_get(ic->sd->obj));
+   evas_event_thaw(e);
    evas_object_show(ic->obj);
+   evas_object_show(ic->rect);
 
    if (ic->selected)
      {
@@ -4890,6 +4903,8 @@ _e_fm2_icon_unrealize(E_Fm2_Icon *ic)
    ic->realized = EINA_FALSE;
    evas_object_del(ic->obj);
    ic->obj = NULL;
+   evas_object_del(ic->rect);
+   ic->rect = NULL;
    evas_object_del(ic->obj_icon);
    ic->obj_icon = NULL;
 }
@@ -5215,7 +5230,10 @@ _e_fm2_region_realize(E_Fm2_Region *rg)
    EINA_LIST_FOREACH(rg->list, l, ic)
      {
         if (ic->selected)
-          evas_object_stack_below(ic->obj, ic->sd->drop);
+          {
+             evas_object_stack_below(ic->obj, ic->sd->drop);
+             evas_object_stack_above(ic->rect, ic->obj);
+          }
      }
    edje_thaw();
 }
@@ -6216,6 +6234,7 @@ _e_fm2_dnd_finish(Evas_Object *obj, int refresh)
         ic->drag.src = EINA_FALSE;
         if (ic->drag.hidden) continue;
         if (ic->obj) evas_object_show(ic->obj);
+        if (ic->rect) evas_object_show(ic->rect);
         if (ic->obj_icon) evas_object_show(ic->obj_icon);
      }
    if (refresh) e_fm2_refresh(obj);
@@ -7274,7 +7293,6 @@ _e_fm2_cb_icon_mouse_up(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNUSE
    ev = event_info;
 
    edje_object_message_signal_process(ic->obj);
-   edje_object_message_signal_process(ic->obj);
 
    _e_fm2_typebuf_hide(ic->sd->obj);
    if ((ev->button == 1) && (!ic->drag.dnd))
@@ -7295,6 +7313,7 @@ _e_fm2_cb_drag_finished_show(E_Fm2_Icon *ic)
 {
    ic->drag.dnd = ic->drag.src = EINA_FALSE;
    if (ic->obj) evas_object_show(ic->obj);
+   if (ic->rect) evas_object_show(ic->rect);
    if (ic->obj_icon) evas_object_show(ic->obj_icon);
    ic->drag.dnd_end_timer = NULL;
    return EINA_FALSE;
@@ -7439,15 +7458,6 @@ _e_fm2_cb_icon_mouse_out(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNUS
    ev = event_info;
 
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
-   /* here we have some stupid checks to see if we're REALLY getting a mouse 
out or
-    * if some jackass is sending us bad events
-    * ticket #1324
-    */
-   if (E_INSIDE(ev->output.x, ev->output.y - 10, ic->sd->x + ic->x - 
ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
-       E_INSIDE(ev->output.x - 10, ev->output.y, ic->sd->x + ic->x - 
ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
-       E_INSIDE(ev->output.x + 10, ev->output.y, ic->sd->x + ic->x - 
ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
-       E_INSIDE(ev->output.x, ev->output.y + 10, ic->sd->x + ic->x - 
ic->sd->pos.x, ic->sd->y + ic->y - ic->sd->pos.y, ic->w, ic->h) &&
-       evas_pointer_inside_get(evas_object_evas_get(ic->sd->obj))) return;
    evas_object_smart_callback_call(ic->sd->obj, "icon_mouse_out", &ic->info);
 }
 
@@ -7512,6 +7522,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNU
              ic->sd->drag = EINA_TRUE;
              ic->drag.dnd = EINA_TRUE;
              if (ic->obj) evas_object_hide(ic->obj);
+             if (ic->rect) evas_object_hide(ic->rect);
              if (ic->obj_icon) evas_object_hide(ic->obj_icon);
              ic->drag.start = EINA_FALSE;
              evas_object_geometry_get(ic->obj, &x, &y, &w, &h);
@@ -7553,6 +7564,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, 
Evas_Object *obj __UNU
 
                   ici->ic->drag.dnd = EINA_TRUE;
                   if (ici->ic->obj) evas_object_hide(ici->ic->obj);
+                  if (ici->ic->rect) evas_object_hide(ici->ic->rect);
                   if (ici->ic->obj_icon) evas_object_hide(ici->ic->obj_icon);
                }
              if (!sel) return;
@@ -8333,7 +8345,11 @@ _e_fm2_obj_icons_place(E_Fm2_Smart_Data *sd)
                   evas_object_move(ic->obj,
                                    sd->x + ic->x - sd->pos.x,
                                    sd->y + ic->y - sd->pos.y);
+                  evas_object_move(ic->rect,
+                                   sd->x + ic->x - sd->pos.x,
+                                   sd->y + ic->y - sd->pos.y);
                   evas_object_resize(ic->obj, ic->w, ic->h);
+                  evas_object_resize(ic->rect, ic->w, ic->h);
                   _e_fm2_icon_thumb(ic, ic->obj_icon, 0);
                   if (_e_fm2_view_mode_get(ic->sd) != E_FM2_VIEW_MODE_LIST) 
continue;
                   /* FIXME: this is probably something that should be 
unnecessary,

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

Reply via email to