summaryrefslogtreecommitdiff
path: root/src/nautilus-pathbar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nautilus-pathbar.c')
-rw-r--r--src/nautilus-pathbar.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 7e19e2448..83d8994c0 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -105,6 +105,7 @@ struct _NautilusPathBar
NautilusFile *context_menu_file;
GtkPopoverMenu *current_view_menu_popover;
+ guint bind_menu_model_to_popover_id;
GtkWidget *current_view_menu_button;
GtkWidget *button_menu_popover;
GMenu *current_view_menu;
@@ -241,6 +242,7 @@ bind_current_view_menu_model_to_popover (NautilusPathBar *self)
{
gtk_popover_menu_set_menu_model (self->current_view_menu_popover,
G_MENU_MODEL (self->current_view_menu));
+ self->bind_menu_model_to_popover_id = 0;
return G_SOURCE_REMOVE;
}
@@ -342,6 +344,8 @@ nautilus_path_bar_dispose (GObject *object)
{
NautilusPathBar *self = NAUTILUS_PATH_BAR (object);
+ g_clear_handle_id (&self->bind_menu_model_to_popover_id, g_source_remove);
+
nautilus_path_bar_clear_buttons (self);
G_OBJECT_CLASS (nautilus_path_bar_parent_class)->dispose (object);
@@ -457,7 +461,10 @@ nautilus_path_bar_set_templates_menu (NautilusPathBar *self,
}
nautilus_gmenu_set_from_model (self->templates_submenu, menu);
- g_idle_add ((GSourceFunc) bind_current_view_menu_model_to_popover, self);
+ if (self->bind_menu_model_to_popover_id == 0)
+ {
+ self->bind_menu_model_to_popover_id = g_idle_add ((GSourceFunc) bind_current_view_menu_model_to_popover, self);
+ }
i = nautilus_g_menu_model_find_by_string (G_MENU_MODEL (self->current_view_menu),
"nautilus-menu-item",