eina: invalidate last add/del rects when the opposite operation occurs
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 5 Feb 2016 19:16:51 +0000 (14:16 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 5 Feb 2016 19:35:28 +0000 (14:35 -0500)
applying this optimization to prevent the same rectangle from being added
or removed repeatedly in succession would result in the rejecting of successive
operations of the same type when the other operation occurred in between.

as an example:

add(0, 0, 100, 100)
del(0, 0, 100, 100)
add(0, 0, 100, 100)

should yield (0, 0, 100, 100), not zero rects and a failure to add the
second rect

this fixes a serious issue in enlightenment where stacking three windows
on top of each other with the first and third windows having the same geometry
would result in the top window receiving no input geometry (oops)

@fix

src/lib/eina/eina_tiler.c

index 555043a..5661a1b 100644 (file)
@@ -1226,6 +1226,7 @@ EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r)
       return EINA_FALSE;
 
    t->last.add = tmp;
+   t->last.del.w = t->last.del.h = -1;
 
    return _splitter_rect_add(t, &tmp);
 }
@@ -1251,6 +1252,7 @@ EAPI void eina_tiler_rect_del(Eina_Tiler *t, const Eina_Rectangle *r)
       return;
 
    t->last.del = tmp;
+   t->last.add.w = t->last.add.h = -1;
 
    _splitter_rect_del(t, &tmp);
 }