summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-07-21 09:48:05 +0200
committerDave Andreoli <dave@gurumeditation.it>2018-07-21 09:48:05 +0200
commit0a4ea24207363fb7b13aebaaee947c7e1291aef5 (patch)
tree369347b73a3fff08647109fafca010be30b556e6
parent44bce025fa478cc52bc23b8f3fed799f8e1b8806 (diff)
Ctxpopup super slow with some more items
If you put some (like 100) items in a ctxpopup it will take 5 seconds to show up and throw all kind of errors on console. This is an example that show the issue, I opened T7176 to track this issue
-rw-r--r--src/bin/elementary/test_ctxpopup.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bin/elementary/test_ctxpopup.c b/src/bin/elementary/test_ctxpopup.c
index 46209a7dfb..9293647d28 100644
--- a/src/bin/elementary/test_ctxpopup.c
+++ b/src/bin/elementary/test_ctxpopup.c
@@ -470,6 +470,31 @@ _list_item_cb10(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_
470} 470}
471 471
472static void 472static void
473_list_item_cb11(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
474{
475 Evas_Object *ctxpopup;
476 Evas_Coord x,y;
477 char label[16];
478 int i = 0;
479
480 if (list_mouse_down > 0) return;
481
482 ctxpopup = elm_ctxpopup_add(obj);
483 evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL);
484 evas_object_smart_callback_add(ctxpopup, "geometry,update", _geometry_update, NULL);
485
486 while (i++ < 100)
487 {
488 snprintf(label, sizeof(label), "Item %d", i);
489 _ctxpopup_item_new(ctxpopup, label, "clock");
490 }
491
492 evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
493 evas_object_move(ctxpopup, x, y);
494 evas_object_show(ctxpopup);
495}
496
497static void
473_list_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 498_list_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
474{ 499{
475 elm_list_item_selected_set(event_info, EINA_FALSE); 500 elm_list_item_selected_set(event_info, EINA_FALSE);
@@ -532,6 +557,8 @@ test_ctxpopup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
532 _list_item_cb9, NULL); 557 _list_item_cb9, NULL);
533 elm_list_item_append(list, "Ctxpopup with user content (enable to remove)", NULL, NULL, 558 elm_list_item_append(list, "Ctxpopup with user content (enable to remove)", NULL, NULL,
534 _list_item_cb10, NULL); 559 _list_item_cb10, NULL);
560 elm_list_item_append(list, "Ctxpopup with more items", NULL, NULL,
561 _list_item_cb11, NULL);
535 evas_object_show(list); 562 evas_object_show(list);
536 elm_list_go(list); 563 elm_list_go(list);
537 564