summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-28 13:49:55 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-28 14:07:17 -0400
commit62c557848b9513381857af8e910250dc9bf67a44 (patch)
treef5d810951954f93777eb70320aedbe198e59a960
parent71b546efba025dae75faef7bc31be7e228399769 (diff)
-rw-r--r--src/lib/elementary/elm_genlist.c29
-rw-r--r--src/lib/elementary/elm_widget_genlist.h1
-rw-r--r--src/tests/ecore/ecore_test_timer.c47
3 files changed, 68 insertions, 9 deletions
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 13e87fa..40b644e 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -469,7 +469,8 @@ _item_content_realize(Elm_Gen_Item *it,
469 469
470 if (elm_widget_is(content)) 470 if (elm_widget_is(content))
471 { 471 {
472 if (!calc) 472 elm_widget_tree_unfocusable_set(content, it->item->unfocusable);
473 if (!calc && (!it->item->unfocusable))
473 _elm_widget_full_eval(content); 474 _elm_widget_full_eval(content);
474 } 475 }
475 } 476 }
@@ -1700,7 +1701,11 @@ _item_cache_find(Elm_Gen_Item *it)
1700 efl_wref_del(itc->base_view, &itc->base_view); 1701 efl_wref_del(itc->base_view, &itc->base_view);
1701 itc->base_view = NULL; 1702 itc->base_view = NULL;
1702 EINA_LIST_FREE(itc->contents, obj) 1703 EINA_LIST_FREE(itc->contents, obj)
1703 elm_widget_tree_unfocusable_set(obj, EINA_FALSE); 1704 {
1705 if (elm_widget_is(obj))
1706 elm_widget_tree_unfocusable_set(obj, it->item->unfocusable);
1707 evas_object_show(obj);
1708 }
1704 itc->contents = NULL; 1709 itc->contents = NULL;
1705 _item_cache_free(itc); 1710 _item_cache_free(itc);
1706 return EINA_TRUE; 1711 return EINA_TRUE;
@@ -1718,7 +1723,8 @@ _content_cache_add(Elm_Gen_Item *it, Eina_List **cache)
1718 { 1723 {
1719 *cache = eina_list_append(*cache, content); 1724 *cache = eina_list_append(*cache, content);
1720 eina_hash_del_by_key(pd->content_item_map, &content); 1725 eina_hash_del_by_key(pd->content_item_map, &content);
1721 elm_widget_tree_unfocusable_set(content, EINA_TRUE); 1726 if (elm_widget_is(content)) elm_widget_tree_unfocusable_set(content, EINA_TRUE);
1727 evas_object_hide(content);
1722 } 1728 }
1723 1729
1724 return *cache; 1730 return *cache;
@@ -5388,6 +5394,15 @@ _item_unrealize(Elm_Gen_Item *it)
5388 it->want_unrealize = EINA_FALSE; 5394 it->want_unrealize = EINA_FALSE;
5389} 5395}
5390 5396
5397static void
5398_item_temp_realize(Elm_Gen_Item *it, const int index)
5399{
5400 it->item->unfocusable = EINA_TRUE;
5401 _item_realize(it, index, EINA_TRUE);
5402 _elm_genlist_item_unrealize(it, EINA_TRUE);
5403 it->item->unfocusable = EINA_FALSE;
5404}
5405
5391static Eina_Bool 5406static Eina_Bool
5392_item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd) 5407_item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd)
5393{ 5408{
@@ -5421,8 +5436,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd)
5421 { 5436 {
5422 if (!size || (it->item->expanded_depth != size->expanded_depth)) 5437 if (!size || (it->item->expanded_depth != size->expanded_depth))
5423 { 5438 {
5424 _item_realize(it, blk_idx + vis_count, EINA_TRUE); 5439 _item_temp_realize(it, blk_idx + vis_count);
5425 _elm_genlist_item_unrealize(it, EINA_TRUE);
5426 } 5440 }
5427 else 5441 else
5428 { 5442 {
@@ -5443,10 +5457,7 @@ _item_block_recalc(Item_Block *itb, const int blk_idx, Eina_Bool qadd)
5443 it->item->mincalcd = EINA_TRUE; 5457 it->item->mincalcd = EINA_TRUE;
5444 } 5458 }
5445 else 5459 else
5446 { 5460 _item_temp_realize(it, blk_idx + vis_count);
5447 _item_realize(it, blk_idx + vis_count, EINA_TRUE);
5448 _elm_genlist_item_unrealize(it, EINA_TRUE);
5449 }
5450 } 5461 }
5451 } 5462 }
5452 else 5463 else
diff --git a/src/lib/elementary/elm_widget_genlist.h b/src/lib/elementary/elm_widget_genlist.h
index 94b3b84..41aef7f 100644
--- a/src/lib/elementary/elm_widget_genlist.h
+++ b/src/lib/elementary/elm_widget_genlist.h
@@ -253,6 +253,7 @@ struct Elm_Gen_Item_Type
253 Eina_Bool queued : 1; 253 Eina_Bool queued : 1;
254 Eina_Bool before : 1; 254 Eina_Bool before : 1;
255 Eina_Bool show_me : 1; 255 Eina_Bool show_me : 1;
256 Eina_Bool unfocusable : 1; /* item is not focusable; propagate to content */
256}; 257};
257 258
258struct _Item_Block 259struct _Item_Block
diff --git a/src/tests/ecore/ecore_test_timer.c b/src/tests/ecore/ecore_test_timer.c
index 06a6485..b5b18f7 100644
--- a/src/tests/ecore/ecore_test_timer.c
+++ b/src/tests/ecore/ecore_test_timer.c
@@ -334,6 +334,52 @@ EFL_START_TEST(ecore_test_timer_iteration)
334} 334}
335EFL_END_TEST 335EFL_END_TEST
336 336
337static Eina_Bool
338_recursion()
339{
340 Ecore_Timer *timer;
341 /* verify multiple timer expiration in single mainloop iteration */
342 ecore_timer_add(0, _timer_cb, (void *) 2);
343 ecore_timer_add(0, _timer_cb, (void *) 3);
344 ecore_main_loop_iterate();
345 /* timers should not expire for one loop iteration */
346 ck_assert_int_eq(count, 1);
347 ecore_timer_add(0, _timer_cb, (void *) 4);
348 ecore_main_loop_iterate();
349 /* all pending and instantiated timers should expire after exactly one loop iteration */
350 ck_assert_int_eq(count, 3);
351 ecore_main_loop_iterate();
352 /* this should not interfere with successive timer processing */
353 ck_assert_int_eq(count, 4);
354
355 /* verify out-of-order timer processing solely based on timer times */
356 timer = ecore_timer_add(1, _timer_cb, (void *) 6);
357 ecore_main_loop_iterate();
358 ck_assert_int_eq(count, 4);
359 ecore_timer_add(0, _timer_cb, (void *) 5);
360 ecore_main_loop_iterate();
361 ck_assert_int_eq(count, 4);
362 /* timer should expire after exactly 2 iterations */
363 ecore_main_loop_iterate();
364 ck_assert_int_eq(count, 5);
365 ecore_timer_interval_set(timer, 0);
366 ecore_timer_reset(timer);
367 /* timer should expire after exactly 2 iterations since it becomes un-instantiated now */
368 ecore_main_loop_iterate();
369 ecore_main_loop_iterate();
370 ck_assert_int_eq(count, 6);
371 return EINA_FALSE;
372}
373
374EFL_START_TEST(ecore_test_timer_recursion)
375{
376 count = 1;
377 ecore_timer_add(0, _recursion, NULL);
378 ecore_main_loop_begin();
379 ck_assert_int_eq(count, 6);
380}
381EFL_END_TEST
382
337void ecore_test_timer(TCase *tc) 383void ecore_test_timer(TCase *tc)
338{ 384{
339 tcase_add_test(tc, ecore_test_timers); 385 tcase_add_test(tc, ecore_test_timers);
@@ -342,4 +388,5 @@ void ecore_test_timer(TCase *tc)
342 tcase_add_test(tc, ecore_test_ecore_main_loop_timer); 388 tcase_add_test(tc, ecore_test_ecore_main_loop_timer);
343 tcase_add_test(tc, ecore_test_timer_in_order); 389 tcase_add_test(tc, ecore_test_timer_in_order);
344 tcase_add_test(tc, ecore_test_timer_iteration); 390 tcase_add_test(tc, ecore_test_timer_iteration);
391 tcase_add_test(tc, ecore_test_timer_recursion);
345} 392}