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)
downloadefl-0a4ea24207363fb7b13aebaaee947c7e1291aef5.tar.gz
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_
}
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)
{
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_
_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);