This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit 2dfae987031d6ec57cfd28285efc65f7bbe56cc0
Author: Cedric BAIL <[email protected]>
AuthorDate: Mon Nov 9 17:13:41 2026 -0600
elementary: collection_view: keep a row or two past the visible range
The view drops the models it fetched outside the visible range plus half
of it. With a range of one row that margin is nothing, so the rows just
below were dropped and answered with a stand-in size right when the next
layout pass showed one more row, and the position manager logged
"Reported sizes changed during caching and placement" for an
Exact_Model: it had added up the real height of a row the view then no
longer had a model for.
Keep at least 2 rows on each side, for the fetch and for the cleanup,
and stop ignoring that message in the Exact_Model test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/elementary/efl_ui_collection_view.c | 22 +++++++++++++++++-----
src/tests/elementary/efl_ui_test_collection_view.c | 8 +-------
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 7878ad7145..593d79dcb6 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -375,6 +375,18 @@ _all_cleanup(Efl_Ui_Collection_View *obj, Efl_Ui_Collection_View_Data *pd)
}
}
+// How far past the visible range rows are kept and fetched. Half the range is too
+// little when the range is a row or two: the next layout pass shows one more row
+// than the last one did, and a row dropped for being just outside is answered
+// with a stand-in size after the position manager has added up its real one.
+#define RANGE_MARGIN_MIN 2
+
+static inline long
+_range_margin(long length)
+{
+ return MAX(length / 2, RANGE_MARGIN_MIN);
+}
+
static inline Eina_Bool
_size_from_model(Efl_Model *model, Eina_Size2D *r, const char *width, const char *height)
{
@@ -1563,8 +1575,8 @@ _idle_cb(void *data, const Efl_Event *event EINA_UNUSED)
Eina_Array scheduled_release;
MY_DATA_GET(data, pd);
const unsigned int length = pd->current_range.end_id - pd->current_range.start_id;
- const unsigned int lower_end = MAX((long)pd->current_range.start_id - (long)length/2, 0);
- const unsigned int upper_end = pd->current_range.end_id + length/2;
+ const unsigned int lower_end = MAX((long)pd->current_range.start_id - _range_margin(length), 0);
+ const unsigned int upper_end = pd->current_range.end_id + _range_margin(length);
Eina_Array_Iterator iterator;
unsigned int i;
@@ -1636,8 +1648,8 @@ _manager_content_visible_range_changed_cb(void *data, const Efl_Event *ev)
count = efl_model_children_count_get(efl_ui_view_model_get(data));
length = pd->current_range.end_id - pd->current_range.start_id;
- lower_end = MAX((long)pd->current_range.start_id - (length / 2), 0);
- upper_end = MIN(pd->current_range.end_id + (length / 2), count);
+ lower_end = MAX((long)pd->current_range.start_id - _range_margin(length), 0);
+ upper_end = MIN(pd->current_range.end_id + _range_margin(length), count);
idx = lower_end;
while (idx < upper_end)
@@ -2207,7 +2219,7 @@ _efl_model_child_removed(void *data, const Efl_Event *event)
count = efl_model_children_count_get(event->object);
length = pd->current_range.end_id - pd->current_range.start_id;
- upper_end = MIN(pd->current_range.end_id + (length / 2), count);
+ upper_end = MIN(pd->current_range.end_id + _range_margin(length), count);
// Check if we really have something to do
#ifdef VIEWPORT_ENABLE
diff --git a/src/tests/elementary/efl_ui_test_collection_view.c b/src/tests/elementary/efl_ui_test_collection_view.c
index 7bcc41a372..71802611dd 100644
--- a/src/tests/elementary/efl_ui_test_collection_view.c
+++ b/src/tests/elementary/efl_ui_test_collection_view.c
@@ -490,13 +490,7 @@ _count_err_cri(const Eina_Log_Domain *d, Eina_Log_Level level,
{
int *n = data;
- // An Exact_Model has no size to stand in for a row the view has no model for
- // yet, and the position manager says so when its cache and its placement of
- // such a row differ. That is not what these tests are about.
- if ((level <= EINA_LOG_LEVEL_ERR) && !eina_str_has_prefix(fmt, "Reported sizes changed"))
- {
- (*n)++;
- }
+ if (level <= EINA_LOG_LEVEL_ERR) (*n)++;
eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.