Skip to content
Snippets Groups Projects
Commit 442461b1 authored by Alexander Schwinn's avatar Alexander Schwinn
Browse files

Regression: Window menu not updated properly (Issue #320)

Fixes #320
Fixes #321
parent ead4f16e
No related branches found
No related tags found
No related merge requests found
Pipeline #846 passed
......@@ -125,6 +125,32 @@ thunar_gtk_menu_thunarx_menu_item_new (GObject *thunarx_menu_item,
/**
* thunar_gtk_menu_clean:
* @menu : a #GtkMenu.
*
* Walks through the menu and all submenus and removes them,
* so that the result will be a clean #GtkMenu without any items
**/
void
thunar_gtk_menu_clean (GtkMenu *menu)
{
GList *children, *lp;
GtkWidget *submenu;
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (lp = children; lp != NULL; lp = lp->next)
{
submenu = gtk_menu_item_get_submenu (lp->data);
if (submenu != NULL)
gtk_widget_destroy (submenu);
gtk_container_remove (GTK_CONTAINER (menu), lp->data);
}
g_list_free (children);
}
/**
* thunar_gtk_menu_run:
* @menu : a #GtkMenu.
......
......@@ -27,6 +27,7 @@ G_BEGIN_DECLS;
void thunar_gtk_label_set_a11y_relation (GtkLabel *label,
GtkWidget *widget);
void thunar_gtk_menu_clean (GtkMenu *menu);
void thunar_gtk_menu_run (GtkMenu *menu);
void thunar_gtk_menu_run_at_event (GtkMenu *menu,
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment