Evas events: Fixed more issues with pointer grabbing.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Jun 2011 02:03:33 +0000 (02:03 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Jun 2011 02:03:33 +0000 (02:03 +0000)
We want to free the grab even if mouse up happened outside of the
object's region (that's the whole point of grabbing...). Also, we don't
want to update the grabbed list anywhere but in mouse down.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@60788 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_events.c

index 9aa73ee..9c02b12 100644 (file)
@@ -354,10 +354,8 @@ _post_up_handle(Evas *e, unsigned int timestamp, const void *data)
      {
         ins = eina_list_free(ins);
      }
-   /* free our old list of ins */
-   e->pointer.object.in = eina_list_free(e->pointer.object.in);
-   /* and set up the new one */
-   e->pointer.object.in = ins;
+   /* free our cur ins */
+   eina_list_free(ins);
    if (e->pointer.inside)
       evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
    return post_called;
@@ -405,7 +403,7 @@ evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int t
              ev.canvas.y = e->pointer.y;
              _evas_event_havemap_adjust(obj, &ev.canvas.x, &ev.canvas.y, obj->mouse_grabbed);
             if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
-                (obj->mouse_in) && (obj->mouse_grabbed > 0))
+                (obj->mouse_grabbed > 0))
               {
                  obj->mouse_grabbed--;
                  e->pointer.mouse_grabbed--;
@@ -743,10 +741,8 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
               }
             if (e->delete_me) break;
          }
-       /* free our old list of ins */
-       eina_list_free(e->pointer.object.in);
-       /* and set up the new one */
-       e->pointer.object.in = ins;
+       /* free our current ins */
+       eina_list_free(ins);
         _evas_post_event_callback_call(e);
      }
    _evas_unwalk(e);
@@ -927,7 +923,7 @@ evas_event_feed_multi_down(Evas *e,
        if (obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB)
          {
             obj->mouse_grabbed++;
-            e->pointer.mouse_grabbed++;
+             e->pointer.mouse_grabbed++;
          }
        if (e->events_frozen <= 0)
          evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_DOWN, &ev);
@@ -993,7 +989,7 @@ evas_event_feed_multi_up(Evas *e,
         if (y != ev.canvas.y)
           ev.canvas.ysub = ev.canvas.y; // fixme - lost precision
         if ((obj->pointer_mode != EVAS_OBJECT_POINTER_MODE_NOGRAB) &&
-            (obj->mouse_in) && (obj->mouse_grabbed > 0))
+            (obj->mouse_grabbed > 0))
           {
              obj->mouse_grabbed--;
              e->pointer.mouse_grabbed--;
@@ -1139,10 +1135,8 @@ evas_event_feed_multi_move(Evas *e,
             if (e->delete_me) break;
          }
        if (copy) copy = eina_list_free(copy);
-       /* free our old list of ins */
-       eina_list_free(e->pointer.object.in);
-       /* and set up the new one */
-       e->pointer.object.in = ins;
+       /* free our current ins */
+       eina_list_free(ins);
         _evas_post_event_callback_call(e);
      }
    _evas_unwalk(e);