summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-05 22:38:02 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-05 22:40:51 +0900
commit25d77bc1d24d9fd539c681fa58db976c1ca65051 (patch)
tree3ccb145660b2dd4eca782ac0263ad0dff24880a2
parent497fc9ecabe9b964ade32543b652faed7fdd3851 (diff)
evas event handling2 - fix incorrect object reporting
this fixes a new bug brought up by 9f0fd66ab818d212fa88faef316ac17625f1a2f5 which fixes event reporting etc. etc. .. this fixes T4017 @fix
-rw-r--r--src/lib/evas/canvas/evas_events.c70
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c2
-rw-r--r--src/lib/evas/include/evas_inline.x22
3 files changed, 84 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 6d4f24aa72..e94321de52 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -134,6 +134,15 @@ _efl_event_desc_get(Evas_Callback_Type type)
134#define EV_RESET(a) do { if (a) efl_event_reset(a); } while (0) 134#define EV_RESET(a) do { if (a) efl_event_reset(a); } while (0)
135#define EV_DEL(a) do { if (a) { eo_unref(a); } a = NULL; } while (0) 135#define EV_DEL(a) do { if (a) { eo_unref(a); } a = NULL; } while (0)
136 136
137#if 0
138# define DDD_DO 1
139# define DDD(...) do { for (i = 0; i < spaces; i++) printf(" "); printf(__VA_ARGS__); } while (0)
140# define D(...) do { printf(__VA_ARGS__); } while (0)
141#else
142# define DDD(...) do { } while (0)
143# define D(...) do { } while (0)
144#endif
145
137static Eina_List * 146static Eina_List *
138_evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, 147_evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
139 const Eina_Inlist *list, Evas_Object *stop, 148 const Eina_Inlist *list, Evas_Object *stop,
@@ -143,7 +152,15 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
143 Evas_Object_Protected_Data *obj = NULL; 152 Evas_Object_Protected_Data *obj = NULL;
144 int inside; 153 int inside;
145 154
155#ifdef DDD_DO
156 static int spaces = 0;
157 int i;
158#endif
159
146 if (!list) return in; 160 if (!list) return in;
161#ifdef DDD_DO
162 spaces++;
163#endif
147 for (obj = _EINA_INLIST_CONTAINER(obj, eina_inlist_last(list)); 164 for (obj = _EINA_INLIST_CONTAINER(obj, eina_inlist_last(list));
148 obj; 165 obj;
149 obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev)) 166 obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev))
@@ -152,16 +169,39 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
152 if (eo_obj == stop) 169 if (eo_obj == stop)
153 { 170 {
154 *no_rep = 1; 171 *no_rep = 1;
172#ifdef DDD_DO
173 spaces--;
174#endif
175 DDD("***** NO REP - STOP *****\n");
155 return in; 176 return in;
156 } 177 }
157 178
158 evas_object_clip_recalc(obj); 179 evas_object_clip_recalc(obj);
159 if ((!RECTS_INTERSECT(x, y, 1, 1, 180 if ((!RECTS_INTERSECT(x, y, 1, 1,
160 obj->cur->cache.clip.x, 181 obj->cur->cache.clip.x,
161 obj->cur->cache.clip.y, 182 obj->cur->cache.clip.y,
162 obj->cur->cache.clip.w, 183 obj->cur->cache.clip.w,
163 obj->cur->cache.clip.h))) 184 obj->cur->cache.clip.h)))
164 continue; 185 {
186 DDD("___ %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] %s\n",
187 obj->object,
188 obj->cur->geometry.x, obj->cur->geometry.y,
189 obj->cur->geometry.w, obj->cur->geometry.h,
190 obj->cur->cache.clip.x, obj->cur->cache.clip.y,
191 obj->cur->cache.clip.w, obj->cur->cache.clip.h,
192 obj->type);
193 continue;
194 }
195 else
196 {
197 DDD("OBJ %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] %s\n",
198 obj->object,
199 obj->cur->geometry.x, obj->cur->geometry.y,
200 obj->cur->geometry.w, obj->cur->geometry.h,
201 obj->cur->cache.clip.x, obj->cur->cache.clip.y,
202 obj->cur->cache.clip.w, obj->cur->cache.clip.h,
203 obj->type);
204 }
165 205
166 if (!source) 206 if (!source)
167 { 207 {
@@ -174,6 +214,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
174 { 214 {
175 if (obj->is_smart) 215 if (obj->is_smart)
176 { 216 {
217 DDD("CHILDREN ->\n");
177 Evas_Object_Protected_Data *clip = obj->cur->clipper; 218 Evas_Object_Protected_Data *clip = obj->cur->clipper;
178 int norep = 0; 219 int norep = 0;
179 220
@@ -232,6 +273,10 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
232 if (!obj->repeat_events) 273 if (!obj->repeat_events)
233 { 274 {
234 *no_rep = 1; 275 *no_rep = 1;
276#ifdef DDD_DO
277 spaces--;
278#endif
279 DDD("***** NO REP1 *****\n");
235 return in; 280 return in;
236 } 281 }
237 } 282 }
@@ -261,10 +306,17 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
261 (evas_object_is_inside(eo_obj, obj, x, y)))) 306 (evas_object_is_inside(eo_obj, obj, x, y))))
262 { 307 {
263 if (!evas_event_freezes_through(eo_obj, obj)) 308 if (!evas_event_freezes_through(eo_obj, obj))
264 in = eina_list_append(in, eo_obj); 309 {
310 DDD("----------------> ADD obj %p\n", obj->object);
311 in = eina_list_append(in, eo_obj);
312 }
265 if (!obj->repeat_events) 313 if (!obj->repeat_events)
266 { 314 {
267 *no_rep = 1; 315 *no_rep = 1;
316#ifdef DDD_DO
317 spaces--;
318#endif
319 DDD("***** NO REP2 *****\n");
268 return in; 320 return in;
269 } 321 }
270 } 322 }
@@ -272,6 +324,9 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
272 } 324 }
273 } 325 }
274 *no_rep = 0; 326 *no_rep = 0;
327#ifdef DDD_DO
328 spaces--;
329#endif
275 return in; 330 return in;
276} 331}
277 332
@@ -1012,9 +1067,11 @@ _evas_event_objects_event_list_no_frozen_check(Evas *eo_e, Evas_Object *stop, in
1012 1067
1013 if (!e->layers) return NULL; 1068 if (!e->layers) return NULL;
1014 1069
1070 D("@@@@@ layer count = %i\n", eina_inlist_count(EINA_INLIST_GET(e->layers)));
1015 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay) 1071 EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
1016 { 1072 {
1017 int no_rep = 0; 1073 int no_rep = 0;
1074 D("############################# check layer %i\n", lay->layer);
1018 in = _evas_event_object_list_in_get(eo_e, in, 1075 in = _evas_event_object_list_in_get(eo_e, in,
1019 EINA_INLIST_GET(lay->objects), 1076 EINA_INLIST_GET(lay->objects),
1020 stop, x, y, &no_rep, EINA_FALSE); 1077 stop, x, y, &no_rep, EINA_FALSE);
@@ -1035,6 +1092,7 @@ evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y)
1035 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 1092 Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
1036 1093
1037 if ((!e->layers) || (e->is_frozen)) return NULL; 1094 if ((!e->layers) || (e->is_frozen)) return NULL;
1095 D("------------------------------GET EVETNS AT ............... %i %i\n", x, y);
1038 return _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y); 1096 return _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y);
1039} 1097}
1040 1098
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index a97112038a..cabdaf26bc 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -1398,6 +1398,8 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected
1398 1398
1399 if (!os->update_boundingbox_needed) return; 1399 if (!os->update_boundingbox_needed) return;
1400 os->update_boundingbox_needed = EINA_FALSE; 1400 os->update_boundingbox_needed = EINA_FALSE;
1401 evas_object_clip_dirty(eo_obj, obj);
1402 if (obj->cur->clipper) evas_object_clip_recalc(obj->cur->clipper);
1401 1403
1402 minx = obj->layer->evas->output.w; 1404 minx = obj->layer->evas->output.w;
1403 miny = obj->layer->evas->output.h; 1405 miny = obj->layer->evas->output.h;
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 857a75596e..ff6a95df47 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -279,10 +279,24 @@ evas_object_clip_recalc(Evas_Object_Protected_Data *obj)
279 } 279 }
280 else 280 else
281 { 281 {
282 cx = obj->cur->geometry.x; 282 if (obj->is_smart)
283 cy = obj->cur->geometry.y; 283 {
284 cw = obj->cur->geometry.w; 284 Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
285 ch = obj->cur->geometry.h; 285
286 evas_object_smart_bounding_box_update(eo_obj, obj);
287 evas_object_smart_bounding_box_get(eo_obj, &bounding_box, NULL);
288 cx = bounding_box.x;
289 cy = bounding_box.y;
290 cw = bounding_box.w;
291 ch = bounding_box.h;
292 }
293 else
294 {
295 cx = obj->cur->geometry.x;
296 cy = obj->cur->geometry.y;
297 cw = obj->cur->geometry.w;
298 ch = obj->cur->geometry.h;
299 }
286 } 300 }
287 301
288 if (obj->cur->color.a == 0 && obj->cur->render_op == EVAS_RENDER_BLEND) 302 if (obj->cur->color.a == 0 && obj->cur->render_op == EVAS_RENDER_BLEND)