This fixes a little regression which caused the VC menu item in the top menubar to be placed after the Help menu item and not before as it used to do.
See more discussion in https://github.com/geany/geany-plugins/commit/c6a7968d5ab71961db4b0a5e721d37... You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/383
-- Commit Summary --
* Use gtk_menu_shell_insert() to add the VC menu item to the menubar
-- File Changes --
M geanyvc/src/geanyvc.c (4)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/383.patch https://github.com/geany/geany-plugins/pull/383.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383
Tested on GTK2 only.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383#issuecomment-192867484
Test OK on GTK3.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383#issuecomment-192868263
Merged #383.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383#event-579208253
menubar = GTK_MENU_SHELL( ui_lookup_widget(geany->main_widgets->window, "menubar1")); menu_vc = gtk_menu_item_new_with_mnemonic(_("_VC"));
gtk_menu_shell_append(menubar, menu_vc);
menubar_children = gtk_container_get_children(GTK_CONTAINER(menubar));
gtk_menu_shell_insert(menubar, menu_vc, g_list_length(menubar_children) - 1);
leaks `menubar_children` https://developer.gnome.org/gtk3/stable/GtkContainer.html#gtk-container-get-...
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383/files#r55143127
menubar = GTK_MENU_SHELL( ui_lookup_widget(geany->main_widgets->window, "menubar1")); menu_vc = gtk_menu_item_new_with_mnemonic(_("_VC"));
gtk_menu_shell_append(menubar, menu_vc);
menubar_children = gtk_container_get_children(GTK_CONTAINER(menubar));
gtk_menu_shell_insert(menubar, menu_vc, g_list_length(menubar_children) - 1);
Nice catch! I didn't check it, usually you don't get references from gtk_/g_* calls unless calling constructors.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383/files#r55143645
menubar = GTK_MENU_SHELL( ui_lookup_widget(geany->main_widgets->window, "menubar1")); menu_vc = gtk_menu_item_new_with_mnemonic(_("_VC"));
gtk_menu_shell_append(menubar, menu_vc);
menubar_children = gtk_container_get_children(GTK_CONTAINER(menubar));
gtk_menu_shell_insert(menubar, menu_vc, g_list_length(menubar_children) - 1);
Same here. I'm working on a fix.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383/files#r55143853
menubar = GTK_MENU_SHELL( ui_lookup_widget(geany->main_widgets->window, "menubar1")); menu_vc = gtk_menu_item_new_with_mnemonic(_("_VC"));
gtk_menu_shell_append(menubar, menu_vc);
menubar_children = gtk_container_get_children(GTK_CONTAINER(menubar));
gtk_menu_shell_insert(menubar, menu_vc, g_list_length(menubar_children) - 1);
https://github.com/geany/geany-plugins/pull/387
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/383/files#r55144046
github-comments@lists.geany.org