diff options
-rw-r--r-- | src/nautilus-pathbar.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index 0c880f31c..5fcdb2013 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -97,6 +97,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; @@ -233,6 +234,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; } @@ -334,6 +336,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); @@ -449,7 +453,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", |