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 ae5ec1251f3edf704ae6c70fb4df9ce8a5d6ff3c
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 8 12:24:52 2026 -0600
elementary: a spotlight container keeps a manager that is set again
Setting the manager the container already holds ended it first (it was
the manager being replaced) and then installed the dead pointer. Keep it
as it is, and let go of the ref it came with, if it has one that is not
its parent's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/lib/elementary/efl_ui_spotlight_container.c | 11 +++++++++++
src/tests/elementary/efl_ui_test_spotlight.c | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c
index 5d89f37550..a825cb6bbf 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.c
+++ b/src/lib/elementary/efl_ui_spotlight_container.c
@@ -657,6 +657,17 @@ _efl_ui_spotlight_container_spotlight_manager_set(Eo *obj, Efl_Ui_Spotlight_Cont
if (transition)
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(transition, EFL_UI_SPOTLIGHT_MANAGER_CLASS));
+ // the manager that is there, set again, stays: ending it would end the one
+ // that is being set. The ref it came with is let go of, as for any manager.
+ if (transition && (transition == pd->transition))
+ {
+ int extra_refs = efl_ref_count(transition) - (efl_parent_get(transition) ? 1 : 0);
+
+ if (extra_refs > 0)
+ efl_unref(transition);
+ return;
+ }
+
// the manager that is there goes first, then the new one (a plain one when
// none is given) is taken over the same way
if (pd->transition)
diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c
index 81f83426fc..0d9b9962bf 100644
--- a/src/tests/elementary/efl_ui_test_spotlight.c
+++ b/src/tests/elementary/efl_ui_test_spotlight.c
@@ -691,6 +691,25 @@ EFL_START_TEST (efl_ui_spotlight_manager_unset)
}
EFL_END_TEST
+// A manager set again stays: it is not the one that is replaced, and not ended.
+EFL_START_TEST (efl_ui_spotlight_manager_twice)
+{
+ Eina_Bool gone = EINA_FALSE;
+ Eo *manager = efl_new(EFL_UI_SPOTLIGHT_FADE_MANAGER_CLASS);
+
+ efl_event_callback_add(manager, EFL_EVENT_DEL, _manager_del, &gone);
+ efl_ui_spotlight_manager_set(container, manager);
+ efl_ref(manager); // (a caller that gives it again, with the ref it takes to do so)
+ efl_ui_spotlight_manager_set(container, manager);
+ ck_assert(!gone);
+ ck_assert_ptr_eq(efl_ui_spotlight_manager_get(container), manager);
+ ck_assert_int_eq(efl_ref_count(manager), 1);
+ // and it is the one in use: set to none, it is ended
+ efl_ui_spotlight_manager_set(container, NULL);
+ ck_assert(gone);
+}
+EFL_END_TEST
+
EFL_START_TEST (efl_ui_spotlight_min_max_sizing)
{
Efl_Ui_Button *btn0, *btn1;
@@ -770,5 +789,6 @@ void efl_ui_test_spotlight(TCase *tc)
tcase_add_test(tc, efl_ui_spotlight_test_pop3);
tcase_add_test(tc, efl_ui_spotlight_animated_transition);
tcase_add_test(tc, efl_ui_spotlight_manager_unset);
+ tcase_add_test(tc, efl_ui_spotlight_manager_twice);
tcase_add_test(tc, efl_ui_spotlight_min_max_sizing);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.