we really should focus when we release mouse AND on_hold is... NOT
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 8 Aug 2011 10:32:32 +0000 (10:32 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 8 Aug 2011 10:32:32 +0000 (10:32 +0000)
set. happy happy joy joy.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@62197 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_widget.c
src/lib/elm_widget.h
src/lib/elm_win.c

index b1212a9..44f50c9 100644 (file)
@@ -233,12 +233,14 @@ _sub_obj_hide(void        *data __UNUSED__,
 }
 
 static void
-_sub_obj_mouse_down(void        *data __UNUSED__,
-                    Evas        *e __UNUSED__,
-                    Evas_Object *obj,
-                    void        *event_info __UNUSED__)
+_sub_obj_mouse_up(void        *data __UNUSED__,
+                  Evas        *e __UNUSED__,
+                  Evas_Object *obj,
+                  void        *event_info)
 {
-   elm_widget_focus_mouse_down_handle(obj);
+   Evas_Event_Mouse_Up *ev = event_info;
+   if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
+      elm_widget_focus_mouse_up_handle(obj);
 }
 
 static void
@@ -986,8 +988,8 @@ elm_widget_resize_object_set(Evas_Object *obj,
           }
         evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_DEL,
                                             _sub_obj_del, sd);
-        evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN,
-                                            _sub_obj_mouse_down, sd);
+        evas_object_event_callback_del_full(sd->resize_obj, EVAS_CALLBACK_MOUSE_UP,
+                                            _sub_obj_mouse_up, sd);
         evas_object_smart_member_del(sd->resize_obj);
         if (_elm_widget_is(sd->resize_obj))
           {
@@ -1007,8 +1009,8 @@ elm_widget_resize_object_set(Evas_Object *obj,
           }
         evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_DEL,
                                             _sub_obj_del, sd);
-        evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_DOWN,
-                                            _sub_obj_mouse_down, sd);
+        evas_object_event_callback_del_full(sobj, EVAS_CALLBACK_MOUSE_UP,
+                                            _sub_obj_mouse_up, sd);
         evas_object_smart_member_del(sobj);
         if (_elm_widget_is(sobj))
           {
@@ -1030,8 +1032,8 @@ elm_widget_resize_object_set(Evas_Object *obj,
         evas_object_smart_member_add(sobj, obj);
         evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL,
                                        _sub_obj_del, sd);
-        evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_DOWN,
-                                       _sub_obj_mouse_down, sd);
+        evas_object_event_callback_add(sobj, EVAS_CALLBACK_MOUSE_UP,
+                                       _sub_obj_mouse_up, sd);
         _smart_reconfigure(sd);
         evas_object_data_set(sobj, "elm-parent", obj);
         evas_object_smart_callback_call(obj, "sub-object-add", sobj);
@@ -2445,7 +2447,7 @@ elm_widget_focus_hide_handle(Evas_Object *obj)
 }
 
 EAPI void
-elm_widget_focus_mouse_down_handle(Evas_Object *obj)
+elm_widget_focus_mouse_up_handle(Evas_Object *obj)
 {
    Evas_Object *o = obj;
    do
index 24c7936..e07515a 100644 (file)
@@ -341,7 +341,7 @@ EAPI Eina_Bool        elm_widget_type_check(const Evas_Object *obj, const char *
 EAPI Eina_List       *elm_widget_stringlist_get(const char *str);
 EAPI void             elm_widget_stringlist_free(Eina_List *list);
 EAPI void             elm_widget_focus_hide_handle(Evas_Object *obj);
-EAPI void             elm_widget_focus_mouse_down_handle(Evas_Object *obj);
+EAPI void             elm_widget_focus_mouse_up_handle(Evas_Object *obj);
 EAPI void             elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj);
 EAPI void             elm_widget_focus_disabled_handle(Evas_Object *obj);
 EAPI void             elm_widget_text_part_set(Evas_Object *obj, const char *part, const char *label);
index 45349e0..860a639 100644 (file)
@@ -1277,13 +1277,15 @@ _win_img_hide(void        *data,
 }
 
 static void
-_win_img_mouse_down(void        *data,
-                    Evas        *e __UNUSED__,
-                    Evas_Object *obj __UNUSED__,
-                    void        *event_info __UNUSED__)
+_win_img_mouse_up(void        *data,
+                  Evas        *e __UNUSED__,
+                  Evas_Object *obj __UNUSED__,
+                  void        *event_info)
 {
    Elm_Win *win = data;
-   elm_widget_focus_mouse_down_handle(win->win_obj);
+   Evas_Event_Mouse_Up *ev = event_info;
+   if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
+      elm_widget_focus_mouse_up_handle(win->win_obj);
 }
 
 static void
@@ -1316,8 +1318,8 @@ _win_inlined_image_set(Elm_Win *win)
 
    evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_HIDE,
                                   _win_img_hide, win);
-   evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_MOUSE_DOWN,
-                                  _win_img_mouse_down, win);
+   evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_MOUSE_UP,
+                                  _win_img_mouse_up, win);
    evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_IN,
                                   _win_img_focus_in, win);
    evas_object_event_callback_add(win->img_obj, EVAS_CALLBACK_FOCUS_OUT,