Author: kelnos
Date: 2007-02-22 07:47:04 +0000 (Thu, 22 Feb 2007)
New Revision: 25010

Modified:
   xfdesktop/trunk/modules/menu/desktop-menu.c
Log:
ditch empty submenus


Modified: xfdesktop/trunk/modules/menu/desktop-menu.c
===================================================================
--- xfdesktop/trunk/modules/menu/desktop-menu.c 2007-02-22 07:46:45 UTC (rev 
25009)
+++ xfdesktop/trunk/modules/menu/desktop-menu.c 2007-02-22 07:47:04 UTC (rev 
25010)
@@ -3,7 +3,7 @@
  *  Copyright (C) 2002-2003 Jasper Huijsmans ([EMAIL PROTECTED])
  *                     2003 Biju Chacko ([EMAIL PROTECTED])
  *                     2004 Danny Milosavljevic <[EMAIL PROTECTED]>
- *                     2004 Brian Tarricone <[EMAIL PROTECTED]>
+ *                     2004-2007 Brian Tarricone <[EMAIL PROTECTED]>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -119,6 +119,11 @@
         gtk_menu_item_set_submenu(GTK_MENU_ITEM(mi), submenu);
         
         desktop_menu_add_items(desktop_menu, frap_submenu, submenu);
+        
+        /* we have to check emptiness down here instead of at the top of the
+         * loop because there may be further submenus that are empty */
+        if(!gtk_container_get_children(GTK_CONTAINER(submenu)))
+            gtk_widget_destroy(mi);
     }
     
     items = g_slist_sort(frap_menu_get_items(frap_menu), compare_items);

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to