This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enventor.

View the commit online.

commit 97b4f5b20b184759141dd6a626d85aebc5d87ac5
Author: Thanatermesis <[email protected]>
AuthorDate: Mon Feb 23 15:53:42 2026 -0500

    fix: Correctly track selected item in file tab
    
    I have identified a potential bug and a logic issue in src/bin/file_tab.c.
    
    1 In list_item_selected_cb, fd->selected_it is updated after the early return check, but it should be updated to the new item it to correctly track state and avoid the
    animator logic being bypassed or re-triggered unnecessarily.
    2 In file_tab_it_remove_internal, the list is modified while potentially being iterated or referenced. More importantly, elm_list_go is called after item deletion, which is
    correct, but there's a logic flaw where if the selected item is removed, the code tries to focus the next/prev item but doesn't explicitly update fd->selected_it, which
    might lead to stale pointers in file_tab_disabled_set.
    3 In list_item_selected_cb, the animator is added but not stored back into the fti struct if one already exists, though it deletes the old one. This is mostly fine, but we
    should ensure the state is consistent.
    
    However, the most critical issue is that fd->selected_it is never updated in list_item_selected_cb when a new item is selected, except for the check at the top.
---
 src/bin/file_tab.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/bin/file_tab.c b/src/bin/file_tab.c
index 272917e..0763851 100644
--- a/src/bin/file_tab.c
+++ b/src/bin/file_tab.c
@@ -75,6 +75,7 @@ list_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED,
    Elm_Object_Item *it = event_info;
 
    if (fd->selected_it == it) return;
+   fd->selected_it = it;
 
    //When list item's close button is clicked, this selection is triggered
    //prior to the close button clicked callback.
@@ -94,8 +95,9 @@ file_tab_it_remove_internal(file_tab_it *fti)
    //FIXME: If this item is main, then it needs to close project.
 
    //If the focused item is removed, then enable next item.
-   if (elm_list_selected_item_get(list) == fti->it)
+   if (g_fd->selected_it == fti->it)
      {
+        g_fd->selected_it = NULL;
         //Next?
         Elm_Object_Item *it;
         it = elm_list_item_next(fti->it);

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

Reply via email to