From 0a4ea24207363fb7b13aebaaee947c7e1291aef5 Mon Sep 17 00:00:00 2001 From: Dave Andreoli Date: Sat, 21 Jul 2018 09:48:05 +0200 Subject: [PATCH] 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 --- src/bin/elementary/test_ctxpopup.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 @@ -469,6 +469,31 @@ _list_item_cb10(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_ _print_current_dir(ctxpopup); } +static void +_list_item_cb11(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + Evas_Object *ctxpopup; + Evas_Coord x,y; + char label[16]; + int i = 0; + + if (list_mouse_down > 0) return; + + ctxpopup = elm_ctxpopup_add(obj); + evas_object_smart_callback_add(ctxpopup, "dismissed", _dismissed, NULL); + evas_object_smart_callback_add(ctxpopup, "geometry,update", _geometry_update, NULL); + + while (i++ < 100) + { + snprintf(label, sizeof(label), "Item %d", i); + _ctxpopup_item_new(ctxpopup, label, "clock"); + } + + evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); + evas_object_move(ctxpopup, x, y); + evas_object_show(ctxpopup); +} + static void _list_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) { @@ -532,6 +557,8 @@ test_ctxpopup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ _list_item_cb9, NULL); elm_list_item_append(list, "Ctxpopup with user content (enable to remove)", NULL, NULL, _list_item_cb10, NULL); + elm_list_item_append(list, "Ctxpopup with more items", NULL, NULL, + _list_item_cb11, NULL); evas_object_show(list); elm_list_go(list);