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 5f01fccd48e46dace3dd2cde4e8b1ddaf8c9ba4b
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Oct 31 13:11:17 2026 -0600

    elementary: an internal text scroller keeps the content it was made with
    
    Efl.Ui.Internal_Text_Scroller inherits Efl.Content.content as an
    optional constructor from Efl.Ui.Scroller, but its finalize always set
    the text table given to initialize as its content, and without one set
    NULL, deleting what the caller had given. It now only does so when
    initialize gave it a table. Efl.Ui.Textbox, its only user, always
    does, so nothing changes for it.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/lib/elementary/efl_ui_internal_text_scroller.c |  7 +++++--
 src/tests/elementary/efl_ui_test_scroller.c        | 17 +++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c b/src/lib/elementary/efl_ui_internal_text_scroller.c
index b3b7b84ee7..2064099ccd 100644
--- a/src/lib/elementary/efl_ui_internal_text_scroller.c
+++ b/src/lib/elementary/efl_ui_internal_text_scroller.c
@@ -147,12 +147,15 @@ _efl_ui_internal_text_scroller_efl_canvas_group_group_calculate(Eo *obj,
 
 EOLIAN static Eo *
 _efl_ui_internal_text_scroller_efl_object_finalize(Eo *obj,
-                                     Efl_Ui_Internal_Text_Scroller_Data *sd EINA_UNUSED)
+                                     Efl_Ui_Internal_Text_Scroller_Data *sd)
 {
    obj = efl_finalize(efl_super(obj, MY_CLASS));
    efl_ui_scrollbar_bar_mode_set(obj,
          EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_OFF);
-   efl_content_set(obj, sd->text_table);
+   /* Without initialize there is no table to show, and what the caller gave
+      as content at construction (Efl.Ui.Scroller keeps it through finalize)
+      stays. */
+   if (sd->text_table) efl_content_set(obj, sd->text_table);
    return obj;
 }
 
diff --git a/src/tests/elementary/efl_ui_test_scroller.c b/src/tests/elementary/efl_ui_test_scroller.c
index 92a5665e8b..a45f6c59ed 100644
--- a/src/tests/elementary/efl_ui_test_scroller.c
+++ b/src/tests/elementary/efl_ui_test_scroller.c
@@ -218,8 +218,25 @@ EFL_START_TEST(efl_ui_test_scroller_connector_unbind)
 }
 EFL_END_TEST
 
+/* Private class: the library exports its getter, the tests have no header. */
+EAPI const Efl_Class *efl_ui_internal_text_scroller_class_get(void);
+
+EFL_START_TEST(efl_ui_test_internal_text_scroller_keeps_constructed_content)
+{
+   Eo *win = win_add(NULL, "win", EFL_UI_WIN_TYPE_BASIC);
+   Eo *content = efl_add(EFL_UI_BOX_CLASS, win);
+   Eo *sc = efl_add(efl_ui_internal_text_scroller_class_get(), win,
+                    efl_content_set(efl_added, content));
+
+   ck_assert_ptr_ne(sc, NULL);
+   ck_assert_ptr_eq(efl_content_get(sc), content);
+   ck_assert(!efl_invalidated_get(content));
+}
+EFL_END_TEST
+
 void efl_ui_test_scroller(TCase *tc)
 {
+   tcase_add_test(tc, efl_ui_test_internal_text_scroller_keeps_constructed_content);
    tcase_add_test(tc, efl_ui_test_scroller_events);
    tcase_add_test(tc, efl_ui_test_scroller_scrollbar);
    tcase_add_test(tc, efl_ui_test_scroller_connector_unbind);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to