eina: invalidate last add/del rects when the opposite operation occurs

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
This commit is contained in:
Mike Blumenkrantz 2016-02-05 14:16:51 -05:00
parent fecdb54674
commit 6a93062b25
1 changed files with 2 additions and 0 deletions

View 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);
}