[Xfce4-commits] <xfce4-panel:devel> Handle visiblity of the menu directory.

Nick Schermer noreply at xfce.org
Fri Feb 19 09:30:01 CET 2010


Updating branch refs/heads/devel
         to 1e3802375341fc9d84e33449b24778bf932028ef (commit)
       from 820a35fe174cbd934b2cbc0a3366ad04983e2da3 (commit)

commit 1e3802375341fc9d84e33449b24778bf932028ef
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Feb 19 09:27:11 2010 +0100

    Handle visiblity of the menu directory.

 plugins/applicationsmenu/applicationsmenu.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index a5aa2c7..e4416bb 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -681,13 +681,14 @@ applications_menu_plugin_menu_add (GtkWidget              *gtk_menu,
                                    GarconMenu             *menu,
                                    ApplicationsMenuPlugin *plugin)
 {
-  GList       *elements, *li;
-  GtkWidget   *mi, *image;
-  const gchar *name, *icon_name;
-  GtkWidget   *submenu;
-  gboolean     has_children = FALSE;
-  gint         size = DEFAULT_ICON_SIZE, w, h;
-  const gchar *command;
+  GList               *elements, *li;
+  GtkWidget           *mi, *image;
+  const gchar         *name, *icon_name;
+  GtkWidget           *submenu;
+  gboolean             has_children = FALSE;
+  gint                 size = DEFAULT_ICON_SIZE, w, h;
+  const gchar         *command;
+  GarconMenuDirectory *directory;
 
   panel_return_val_if_fail (GTK_IS_MENU (gtk_menu), FALSE);
   panel_return_val_if_fail (GARCON_IS_MENU (menu), FALSE);
@@ -746,6 +747,14 @@ applications_menu_plugin_menu_add (GtkWidget              *gtk_menu,
         }
       else if (GARCON_IS_MENU (li->data))
         {
+          /* the element check for menu also copies the item list to
+           * check if all the elements are visible, we do that with the
+           * return value of this function, so avoid that and only check
+           * the visibility of the menu directory */
+          directory = garcon_menu_get_directory (li->data);
+          if (!garcon_menu_directory_get_visible (directory))
+            continue;
+
           submenu = gtk_menu_new ();
           if (applications_menu_plugin_menu_add (submenu, li->data, plugin))
             {



More information about the Xfce4-commits mailing list