Here is a patch that fixes e_fm sending "selected" callbacks twice per-click.

This was noticed in illume-home module. When launching an app, sometimes the app would start twice. Turns out, e_fm was sending the "selected" callback more than once.

I did not direct commit this because I am not 100% sure it is the proper fix as I don't know e_fm internals too well.

dh
Index: e_fm.c
===================================================================
--- e_fm.c      (revision 45469)
+++ e_fm.c      (working copy)
@@ -5515,7 +5515,7 @@
    ic = _e_fm2_icon_first_selected_find(obj);
    if (ic)
      {
-       if (_e_fm2_inplace_open(ic) == 0)
+       if (_e_fm2_inplace_open(ic) == 0) 
          evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
      }
 }
@@ -6353,6 +6353,7 @@
        const Eina_List *l;
        E_Fm2_Icon *ic2;
        Eina_Bool seen = 0;
+
        /* find last selected - if any, and select all icons between */
        EINA_LIST_FOREACH(ic->sd->icons, l, ic2)
          {
@@ -6388,6 +6389,7 @@
      {
        const Eina_List *l;
        E_Fm2_Icon *ic2;
+
        /* desel others */
        EINA_LIST_FOREACH(ic->sd->icons, l, ic2)
          {
@@ -6407,6 +6409,7 @@
          {
             const Eina_List *l;
             E_Fm2_Icon *ic2;
+
             EINA_LIST_FOREACH(ic->sd->icons, l, ic2)
                ic2->last_selected = 0;
          }
@@ -6445,7 +6448,7 @@
              int icon_pos_y = ic->y + ic->sd->y - ic->sd->pos.y;
 
              if (eu->output.x >= icon_pos_x && eu->output.x <= (icon_pos_x + 
ic->w) &&
-                 eu->output.y >= icon_pos_y && eu->output.y <= (icon_pos_y + 
ic->h))
+                 eu->output.y >= icon_pos_y && eu->output.y <= (icon_pos_y + 
ic->h)) 
                evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
           }
      }
@@ -6460,15 +6463,14 @@
    ic = data;
    ev = event_info;
 
-   if (ic->entry_widget)
-      return;
-
+   if (ic->entry_widget) return;
    if ((ev->button == 1) && (ev->flags & EVAS_BUTTON_DOUBLE_CLICK))
      {
        /* if its a directory && open dirs in-place is set then change the dir
         * to be the dir + file */
-       if (_e_fm2_inplace_open(ic) == 0)
-         evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
+       if (_e_fm2_inplace_open(ic) == 0) 
+          evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
+
        /* if its in file selector mode then signal that a selection has
         * taken place and dont do anything more */
 
@@ -6488,7 +6490,7 @@
             ic->drag.dnd = 0;
             ic->drag.src = 1;
          }
-         _e_fm2_mouse_1_handler(ic, 0, ev);
+        _e_fm2_mouse_1_handler(ic, 0, ev);
      }
    else if (ev->button == 3)
      {
@@ -6517,11 +6519,13 @@
        ic->drag.src = 0;
         ic->down_sel = 0;
 
+        /*
        if ((ic->sd->config->view.single_click) &&
            (!evas_key_modifier_is_set(ev->modifiers, "Control")) &&
            (!evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
-           (_e_fm2_inplace_open(ic) == 0))
+           (_e_fm2_inplace_open(ic) == 0)) 
           evas_object_smart_callback_call(ic->sd->obj, "selected", NULL);
+         */
      }
 }
 
@@ -6940,7 +6944,7 @@
             ic = _e_fm2_icon_first_selected_find(obj);
             if (ic)
               {
-                 if (_e_fm2_inplace_open(ic) == 0)
+                 if (_e_fm2_inplace_open(ic) == 0) 
                    evas_object_smart_callback_call(ic->sd->obj, "selected", 
NULL);
               }
          }
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to