Fix critical when right-clicking on the document notebook outside a tab

This commit is contained in:
Colomban Wendling 2017-12-03 18:22:52 -08:00
parent bd22fef060
commit 4a304e983c

View File

@ -503,7 +503,7 @@ static void show_tab_bar_popup_menu(GdkEventButton *event, GeanyDocument *doc)
gtk_widget_show(menu_item); gtk_widget_show(menu_item);
gtk_container_add(GTK_CONTAINER(menu), menu_item); gtk_container_add(GTK_CONTAINER(menu), menu_item);
g_signal_connect(menu_item, "activate", G_CALLBACK(on_close_documents_right_activate), doc); g_signal_connect(menu_item, "activate", G_CALLBACK(on_close_documents_right_activate), doc);
gtk_widget_set_sensitive(GTK_WIDGET(menu_item), has_tabs_on_right(doc)); gtk_widget_set_sensitive(GTK_WIDGET(menu_item), doc != NULL && has_tabs_on_right(doc));
menu_item = ui_image_menu_item_new(GTK_STOCK_CLOSE, _("C_lose All")); menu_item = ui_image_menu_item_new(GTK_STOCK_CLOSE, _("C_lose All"));
gtk_widget_show(menu_item); gtk_widget_show(menu_item);