summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-05 15:40:12 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-05 15:42:52 +0900
commit9f0fd66ab818d212fa88faef316ac17625f1a2f5 (patch)
treee97fb64a98109579e1e3b6d77d2990750575ad49
parentf955a20c02b0160f6ac597b8c28104557dc7de28 (diff)
evas event handling - fix incorrect object reporting
this fixes event reporting for mouse in/out/move/down/up due to evas just totally getting tese objects wrong. this fixes T3718 @fix
-rw-r--r--src/lib/evas/canvas/evas_events.c12
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c58
2 files changed, 39 insertions, 31 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 8bf07e45b3..28725f3553 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -144,7 +144,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
144 int inside; 144 int inside;
145 145
146 if (!list) return in; 146 if (!list) return in;
147 for (obj = _EINA_INLIST_CONTAINER(obj, list); 147 for (obj = _EINA_INLIST_CONTAINER(obj, eina_inlist_last(list));
148 obj; 148 obj;
149 obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev)) 149 obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev))
150 { 150 {
@@ -154,6 +154,15 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
154 *no_rep = 1; 154 *no_rep = 1;
155 return in; 155 return in;
156 } 156 }
157
158 evas_object_clip_recalc(obj);
159 if ((!RECTS_INTERSECT(x, y, 1, 1,
160 obj->cur->cache.clip.x,
161 obj->cur->cache.clip.y,
162 obj->cur->cache.clip.w,
163 obj->cur->cache.clip.h)))
164 continue;
165
157 if (!source) 166 if (!source)
158 { 167 {
159 if (evas_event_passes_through(eo_obj, obj)) continue; 168 if (evas_event_passes_through(eo_obj, obj)) continue;
@@ -989,7 +998,6 @@ _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
989 const Eina_Inlist *list, Evas_Object *stop, 998 const Eina_Inlist *list, Evas_Object *stop,
990 int x, int y, int *no_rep, Eina_Bool source) 999 int x, int y, int *no_rep, Eina_Bool source)
991{ 1000{
992 if (!list) return NULL;
993 return _evas_event_object_list_raw_in_get(eo_e, in, list->last, stop, x, y, 1001 return _evas_event_object_list_raw_in_get(eo_e, in, list->last, stop, x, y,
994 no_rep, source); 1002 no_rep, source);
995} 1003}
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index b268ff3f7a..a97112038a 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -1157,13 +1157,13 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1157 /* Update left limit */ 1157 /* Update left limit */
1158 if (noclip && x < smart_parent->cur.bounding_box.x) 1158 if (noclip && x < smart_parent->cur.bounding_box.x)
1159 { 1159 {
1160 smart_parent->cur.bounding_box.w += smart_parent->cur.bounding_box.x - x; 1160 smart_parent->cur.bounding_box.w += smart_parent->cur.bounding_box.x - x;
1161 smart_parent->cur.bounding_box.x = x; 1161 smart_parent->cur.bounding_box.x = x;
1162 1162
1163 propagate = EINA_TRUE; 1163 propagate = EINA_TRUE;
1164 } 1164 }
1165 else if ((px == smart_parent->prev.bounding_box.x && 1165 else if ((px == smart_parent->prev.bounding_box.x &&
1166 x > smart_parent->cur.bounding_box.x) 1166 x > smart_parent->cur.bounding_box.x)
1167 || (!noclip && x == smart_parent->cur.bounding_box.x)) 1167 || (!noclip && x == smart_parent->cur.bounding_box.x))
1168 { 1168 {
1169 computeminmax = EINA_TRUE; 1169 computeminmax = EINA_TRUE;
@@ -1178,7 +1178,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1178 propagate = EINA_TRUE; 1178 propagate = EINA_TRUE;
1179 } 1179 }
1180 else if ((py == smart_parent->prev.bounding_box.y && 1180 else if ((py == smart_parent->prev.bounding_box.y &&
1181 y > smart_parent->cur.bounding_box.y) 1181 y > smart_parent->cur.bounding_box.y)
1182 || (!noclip && y == smart_parent->cur.bounding_box.y)) 1182 || (!noclip && y == smart_parent->cur.bounding_box.y))
1183 { 1183 {
1184 computeminmax = EINA_TRUE; 1184 computeminmax = EINA_TRUE;
@@ -1187,8 +1187,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1187 /* Update right limit */ 1187 /* Update right limit */
1188 if (noclip && x + w > smart_parent->cur.bounding_box.x + smart_parent->cur.bounding_box.w) 1188 if (noclip && x + w > smart_parent->cur.bounding_box.x + smart_parent->cur.bounding_box.w)
1189 { 1189 {
1190 smart_parent->cur.bounding_box.w = x + w - smart_parent->cur.bounding_box.x; 1190 smart_parent->cur.bounding_box.w = x + w - smart_parent->cur.bounding_box.x;
1191
1192 propagate = EINA_TRUE; 1191 propagate = EINA_TRUE;
1193 } 1192 }
1194 else if ((px + pw == smart_parent->prev.bounding_box.x + smart_parent->prev.bounding_box.w && 1193 else if ((px + pw == smart_parent->prev.bounding_box.x + smart_parent->prev.bounding_box.w &&
@@ -1201,7 +1200,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1201 /* Update bottom limit */ 1200 /* Update bottom limit */
1202 if (noclip && y + h > smart_parent->cur.bounding_box.y + smart_parent->cur.bounding_box.h) 1201 if (noclip && y + h > smart_parent->cur.bounding_box.y + smart_parent->cur.bounding_box.h)
1203 { 1202 {
1204 smart_parent->cur.bounding_box.h = y + h - smart_parent->cur.bounding_box.y; 1203 smart_parent->cur.bounding_box.h = y + h - smart_parent->cur.bounding_box.y;
1205 1204
1206 propagate = EINA_TRUE; 1205 propagate = EINA_TRUE;
1207 } 1206 }
@@ -1212,7 +1211,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1212 computeminmax = EINA_TRUE; 1211 computeminmax = EINA_TRUE;
1213 } 1212 }
1214 1213
1215 if (computeminmax) 1214 if (computeminmax)
1216 { 1215 {
1217 evas_object_smart_need_bounding_box_update(obj->smart.parent, 1216 evas_object_smart_need_bounding_box_update(obj->smart.parent,
1218 obj->smart.parent_data, 1217 obj->smart.parent_data,
@@ -1223,14 +1222,14 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1223 { 1222 {
1224 if (noclip) 1223 if (noclip)
1225 { 1224 {
1226 smart_parent->cur.bounding_box.x = x; 1225 smart_parent->cur.bounding_box.x = x;
1227 smart_parent->cur.bounding_box.y = y; 1226 smart_parent->cur.bounding_box.y = y;
1228 smart_parent->cur.bounding_box.w = w; 1227 smart_parent->cur.bounding_box.w = w;
1229 smart_parent->cur.bounding_box.h = h; 1228 smart_parent->cur.bounding_box.h = h;
1230 1229
1231 EINA_COW_STATE_WRITE_BEGIN(smart_obj, smart_write, cur) 1230 EINA_COW_STATE_WRITE_BEGIN(smart_obj, smart_write, cur)
1232 smart_write->valid_bounding_box = EINA_TRUE; 1231 smart_write->valid_bounding_box = EINA_TRUE;
1233 EINA_COW_STATE_WRITE_END(smart_obj, smart_write, cur); 1232 EINA_COW_STATE_WRITE_END(smart_obj, smart_write, cur);
1234 1233
1235 propagate = EINA_TRUE; 1234 propagate = EINA_TRUE;
1236 } 1235 }
@@ -1242,17 +1241,17 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data
1242 1241
1243void 1242void
1244evas_object_smart_bounding_box_get(Evas_Object *eo_obj, 1243evas_object_smart_bounding_box_get(Evas_Object *eo_obj,
1245 Evas_Coord_Rectangle *cur_bounding_box, 1244 Evas_Coord_Rectangle *cur_bounding_box,
1246 Evas_Coord_Rectangle *prev_bounding_box) 1245 Evas_Coord_Rectangle *prev_bounding_box)
1247{ 1246{
1248 Evas_Smart_Data *s = eo_data_scope_get(eo_obj, MY_CLASS); 1247 Evas_Smart_Data *s = eo_data_scope_get(eo_obj, MY_CLASS);
1249 1248
1250 if (cur_bounding_box) memcpy(cur_bounding_box, 1249 if (cur_bounding_box) memcpy(cur_bounding_box,
1251 &s->cur.bounding_box, 1250 &s->cur.bounding_box,
1252 sizeof (*cur_bounding_box)); 1251 sizeof (*cur_bounding_box));
1253 if (prev_bounding_box) memcpy(prev_bounding_box, 1252 if (prev_bounding_box) memcpy(prev_bounding_box,
1254 &s->prev.bounding_box, 1253 &s->prev.bounding_box,
1255 sizeof (*prev_bounding_box)); 1254 sizeof (*prev_bounding_box));
1256} 1255}
1257 1256
1258void 1257void
@@ -1413,24 +1412,25 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected
1413 1412
1414 if (o == obj) continue ; 1413 if (o == obj) continue ;
1415 if (o->clip.clipees || o->is_static_clip) continue ; 1414 if (o->clip.clipees || o->is_static_clip) continue ;
1415 if (!o->cur->visible) continue;
1416 1416
1417 if (o->is_smart) 1417 if (o->is_smart)
1418 { 1418 {
1419 Evas_Smart_Data *s = eo_data_scope_get(o->object, MY_CLASS); 1419 Evas_Smart_Data *s = eo_data_scope_get(o->object, MY_CLASS);
1420 1420
1421 evas_object_smart_bounding_box_update(o->object, o); 1421 evas_object_smart_bounding_box_update(o->object, o);
1422 1422
1423 tx = s->cur.bounding_box.x; 1423 tx = s->cur.bounding_box.x;
1424 ty = s->cur.bounding_box.y; 1424 ty = s->cur.bounding_box.y;
1425 tw = s->cur.bounding_box.x + s->cur.bounding_box.w; 1425 tw = tx + s->cur.bounding_box.w;
1426 th = s->cur.bounding_box.y + s->cur.bounding_box.h; 1426 th = ty + s->cur.bounding_box.h;
1427 } 1427 }
1428 else 1428 else
1429 { 1429 {
1430 tx = o->cur->geometry.x; 1430 tx = o->cur->geometry.x;
1431 ty = o->cur->geometry.y; 1431 ty = o->cur->geometry.y;
1432 tw = o->cur->geometry.x + o->cur->geometry.w; 1432 tw = tx + o->cur->geometry.w;
1433 th = o->cur->geometry.y + o->cur->geometry.h; 1433 th = ty + o->cur->geometry.h;
1434 } 1434 }
1435 1435
1436 if (tx < minx) minx = tx; 1436 if (tx < minx) minx = tx;
@@ -1442,13 +1442,13 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected
1442 if (minx != os->cur.bounding_box.x) 1442 if (minx != os->cur.bounding_box.x)
1443 { 1443 {
1444 os->cur.bounding_box.w += os->cur.bounding_box.x - minx; 1444 os->cur.bounding_box.w += os->cur.bounding_box.x - minx;
1445 os->cur.bounding_box.x = minx; 1445 os->cur.bounding_box.x = minx;
1446 } 1446 }
1447 1447
1448 if (miny != os->cur.bounding_box.y) 1448 if (miny != os->cur.bounding_box.y)
1449 { 1449 {
1450 os->cur.bounding_box.h += os->cur.bounding_box.y - miny; 1450 os->cur.bounding_box.h += os->cur.bounding_box.y - miny;
1451 os->cur.bounding_box.y = miny; 1451 os->cur.bounding_box.y = miny;
1452 } 1452 }
1453 1453
1454 if (maxw != os->cur.bounding_box.x + os->cur.bounding_box.w) 1454 if (maxw != os->cur.bounding_box.x + os->cur.bounding_box.w)