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

git pushed a commit to branch ibar-onclick-toggle
in repository enlightenment.

View the commit online.

commit 8d3a3ab7e651183269a9f62a46960906f0b2939b
Author: Swagtoy <m...@ow.swag.toys>
AuthorDate: Wed Jun 25 03:14:03 2025 -0400

    Ibar: Validate client to prevent crash
    
    Maybe the sign of a memleak or something in Ibar? Maybe rasterman can chime in on this. I noticed in particular when I had the ++i incrementer at the beginning of the loop, it would skip windows from 0, 1, straight to 4 or 6 or something, based on how i launch new instances
---
 src/modules/ibar/e_mod_main.c | 49 +++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index e58052687..955b877bd 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -1665,37 +1665,40 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_
              e_util_menu_item_theme_icon_set(mi, "list-remove");
              e_menu_item_callback_set(mi, _ibar_cb_menu_icon_remove, ic);
           }
-		
+        
         if (ic->exes)
           {
-             E_Exec_Instance *exe = eina_list_nth(ic->exes, 0);
+             E_Exec_Instance *exe = eina_list_data_get(ic->exes);
              int i = 0;
              mi = NULL;
              EINA_LIST_FOREACH(ic->exes, it, exe)
                {
-                  ++i;
                   E_Client *client = eina_list_data_get(exe->clients);
-                  e_int_client_menu_create(client);
-	 		 	  
-                  mi = e_menu_item_new_relative(m, mi);
-				  if (only_one_win)
-				    {
-					   e_menu_item_label_set(mi, _("Window"));
-					}
-				  else
-				    {
-                  	   snprintf(buf, sizeof(buf), _("Window %d"), i);
-                  	   e_menu_item_label_set(mi, buf);
-					}
-                  e_util_desktop_menu_item_icon_add(ic->app,
-                                                    e_util_icon_size_normalize(96 * e_scale),
-                                                    mi);
-                  e_menu_item_callback_set(mi, _ibar_cb_menu_client_show, client);
-                  e_menu_item_submenu_set(mi, client->border_menu);
-                  client->border_menu = NULL;
+                  if (client)
+                  {
+                     e_int_client_menu_create(client);
+
+                     mi = e_menu_item_new_relative(m, mi);
+                     if (only_one_win)
+                       {
+                          e_menu_item_label_set(mi, _("Window"));
+                       }
+                     else
+                       {
+                          ++i;
+                          snprintf(buf, sizeof(buf), _("Window %d"), i);
+                          e_menu_item_label_set(mi, buf);
+                       }
+                     e_util_desktop_menu_item_icon_add(ic->app,
+                                                       e_util_icon_size_normalize(96 * e_scale),
+                                                       mi);
+                     e_menu_item_callback_set(mi, _ibar_cb_menu_client_show, client);
+                     e_menu_item_submenu_set(mi, client->border_menu);
+                  }
+                  //client->border_menu = NULL;
                }
-			   
-			   
+               
+               
              mi = e_menu_item_new_relative(m, mi);
              e_menu_item_separator_set(mi, 1);
           }

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

Reply via email to